gcc/gcc/config/sparc/sparc.h

1793 lines
67 KiB
C
Raw Normal View History

1992-01-30 21:58:19 +01:00
/* Definitions of target machine for GNU compiler, for Sun SPARC.
Copyright (C) 1987-2014 Free Software Foundation, Inc.
1992-01-30 21:58:19 +01:00
Contributed by Michael Tiemann (tiemann@cygnus.com).
64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
at Cygnus Support.
1992-01-30 21:58:19 +01:00
2003-09-27 06:48:30 +02:00
This file is part of GCC.
1992-01-30 21:58:19 +01:00
2003-09-27 06:48:30 +02:00
GCC is free software; you can redistribute it and/or modify
1992-01-30 21:58:19 +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-01-30 21:58:19 +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-01-30 21:58:19 +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-01-30 21:58:19 +01:00
#include "config/vxworks-dummy.h"
1992-01-30 21:58:19 +01:00
/* Note that some other tm.h files include this one and then override
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
whatever definitions are necessary. */
#define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
/* #define SPARC_BI_ARCH */
/* Macro used later in this file to determine default architecture. */
#define DEFAULT_ARCH32_P ((TARGET_DEFAULT & MASK_64BIT) == 0)
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* TARGET_ARCH{32,64} are the main macros to decide which of the two
architectures to compile for. We allow targets to choose compile time or
runtime selection. */
#ifdef IN_LIBGCC2
#if defined(__sparcv9) || defined(__arch64__)
#define TARGET_ARCH32 0
#else
#define TARGET_ARCH32 1
#endif /* sparc64 */
#else
#ifdef SPARC_BI_ARCH
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define TARGET_ARCH32 (! TARGET_64BIT)
#else
#define TARGET_ARCH32 (DEFAULT_ARCH32_P)
#endif /* SPARC_BI_ARCH */
#endif /* IN_LIBGCC2 */
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define TARGET_ARCH64 (! TARGET_ARCH32)
/* Code model selection in 64-bit environment.
The machine mode used for addresses is 32-bit wide:
TARGET_CM_32: 32-bit address space.
It is the code model used when generating 32-bit code.
The machine mode used for addresses is 64-bit wide:
TARGET_CM_MEDLOW: 32-bit address space.
The executable must be in the low 32 bits of memory.
This avoids generating %uhi and %ulo terms. Programs
can be statically or dynamically linked.
TARGET_CM_MEDMID: 44-bit address space.
The executable must be in the low 44 bits of memory,
and the %[hml]44 terms are used. The text and data
segments have a maximum size of 2GB (31-bit span).
The maximum offset from any instruction to the label
_GLOBAL_OFFSET_TABLE_ is 2GB (31-bit span).
TARGET_CM_MEDANY: 64-bit address space.
The text and data segments have a maximum size of 2GB
(31-bit span) and may be located anywhere in memory.
The maximum offset from any instruction to the label
_GLOBAL_OFFSET_TABLE_ is 2GB (31-bit span).
TARGET_CM_EMBMEDANY: 64-bit address space.
The text and data segments have a maximum size of 2GB
(31-bit span) and may be located anywhere in memory.
The global register %g4 contains the start address of
the data segment. Programs are statically linked and
PIC is not supported.
Different code models are not supported in 32-bit environment. */
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
enum cmodel {
CM_32,
CM_MEDLOW,
CM_MEDMID,
CM_MEDANY,
CM_EMBMEDANY
};
/* One of CM_FOO. */
extern enum cmodel sparc_cmodel;
/* V9 code model selection. */
#define TARGET_CM_MEDLOW (sparc_cmodel == CM_MEDLOW)
#define TARGET_CM_MEDMID (sparc_cmodel == CM_MEDMID)
#define TARGET_CM_MEDANY (sparc_cmodel == CM_MEDANY)
#define TARGET_CM_EMBMEDANY (sparc_cmodel == CM_EMBMEDANY)
#define SPARC_DEFAULT_CMODEL CM_32
/* The SPARC-V9 architecture defines a relaxed memory ordering model (RMO)
which requires the following macro to be true if enabled. Prior to V9,
there are no instructions to even talk about memory synchronization.
Note that the UltraSPARC III processors don't implement RMO, unlike the
UltraSPARC II processors. Niagara, Niagara-2, and Niagara-3 do not
implement RMO either.
Default to false; for example, Solaris never enables RMO, only ever uses
total memory ordering (TMO). */
#define SPARC_RELAXED_ORDERING false
/* Do not use the .note.GNU-stack convention by default. */
#define NEED_INDICATE_EXEC_STACK 0
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* This is call-clobbered in the normal ABI, but is reserved in the
home grown (aka upward compatible) embedded ABI. */
#define EMBMEDANY_BASE_REG "%g4"
/* Values of TARGET_CPU_DEFAULT, set via -D in the Makefile,
and specified by the user via --with-cpu=foo.
This specifies the cpu implementation, not the architecture size. */
/* Note that TARGET_CPU_v9 is assumed to start the list of 64-bit
capable cpu's. */
#define TARGET_CPU_sparc 0
#define TARGET_CPU_v7 0 /* alias */
#define TARGET_CPU_cypress 0 /* alias */
#define TARGET_CPU_v8 1 /* generic v8 implementation */
#define TARGET_CPU_supersparc 2
#define TARGET_CPU_hypersparc 3
#define TARGET_CPU_leon 4
2013-07-22 23:41:44 +02:00
#define TARGET_CPU_leon3 5
#define TARGET_CPU_leon3v7 6
#define TARGET_CPU_sparclite 7
#define TARGET_CPU_f930 7 /* alias */
#define TARGET_CPU_f934 7 /* alias */
#define TARGET_CPU_sparclite86x 8
#define TARGET_CPU_sparclet 9
#define TARGET_CPU_tsc701 9 /* alias */
#define TARGET_CPU_v9 10 /* generic v9 implementation */
#define TARGET_CPU_sparcv9 10 /* alias */
#define TARGET_CPU_sparc64 10 /* alias */
#define TARGET_CPU_ultrasparc 11
#define TARGET_CPU_ultrasparc3 12
#define TARGET_CPU_niagara 13
#define TARGET_CPU_niagara2 14
#define TARGET_CPU_niagara3 15
#define TARGET_CPU_niagara4 16
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
|| TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
|| TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \
|| TARGET_CPU_DEFAULT == TARGET_CPU_niagara \
|| TARGET_CPU_DEFAULT == TARGET_CPU_niagara2 \
|| TARGET_CPU_DEFAULT == TARGET_CPU_niagara3 \
|| TARGET_CPU_DEFAULT == TARGET_CPU_niagara4
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#define CPP_CPU32_DEFAULT_SPEC ""
#define ASM_CPU32_DEFAULT_SPEC ""
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
/* ??? What does Sun's CC pass? */
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
/* ??? It's not clear how other assemblers will handle this, so by default
use GAS. Sun's Solaris assembler recognizes -xarch=v8plus, but this case
is handled in sol2.h. */
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#define ASM_CPU64_DEFAULT_SPEC "-Av9"
#endif
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
#endif
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara2
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara3
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9" AS_NIAGARA3_FLAG
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara4
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
Add support for sparc fused compare-and-branch. gcc/ 2012-11-15 David S. Miller <davem@davemloft.net> * configure.ac: Add check for assembler SPARC4 instruction support. * configure: Rebuild. * config.in: Add HAVE_AS_SPARC4 section. * config/sparc/sparc.opt (mcbcond): New option. * doc/invoke.texi: Document it. * config/sparc/constraints.md: New constraint 'A' for 5-bit signed immediates. * doc/md.texi: Document it. * config/sparc/sparc.c (dump_target_flag_bits): Handle MASK_CBCOND. (sparc_option_override): Likewise. (emit_cbcond_insn): New function. (emit_conditional_branch_insn): Call it. (emit_cbcond_nop): New function. (output_ubranch): Use cbcond, remove label arg. (output_cbcond): New function. * config/sparc/sparc-protos.h (output_ubranch): Update. (output_cbcond): Declare it. (emit_cbcond_nop): Likewise. * config/sparc/sparc.md (type attribute): New types 'cbcond' and uncond_cbcond. (emit_cbcond_nop): New attribute. (length attribute): Handle cbcond and uncond_cbcond. (in_call_delay attribute): Reject cbcond and uncond_cbcond. (in_branch_delay attribute): Likewise. (in_uncond_branch_delay attribute): Likewise. (in_annul_branch_delay attribute): Likewise. (*cbcond_sp32, *cbcond_sp64): New insn patterns. (jump): Rewrite into an expander. (*jump_ubranch, *jump_cbcond): New patterns. * config/sparc/niagara4.md: Match 'cbcond' in 'n4_cti'. * config/sparc/sparc.h (AS_NIAGARA4_FLAG): New macro, use it when target default is niagara4. (SPARC_SIMM5_P): Define. * config/sparc/sol2.h (AS_SPARC64_FLAG): Adjust. (AS_SPARC32_FLAG): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Use AS_NIAGARA4_FLAG as needed. From-SVN: r193543
2012-11-15 22:24:22 +01:00
#define ASM_CPU64_DEFAULT_SPEC AS_NIAGARA4_FLAG
#endif
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#else
#define CPP_CPU64_DEFAULT_SPEC ""
#define ASM_CPU64_DEFAULT_SPEC ""
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparc \
|| TARGET_CPU_DEFAULT == TARGET_CPU_v8
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#define CPP_CPU32_DEFAULT_SPEC ""
#define ASM_CPU32_DEFAULT_SPEC ""
#endif
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclet
#define CPP_CPU32_DEFAULT_SPEC "-D__sparclet__"
#define ASM_CPU32_DEFAULT_SPEC "-Asparclet"
#endif
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite
#define CPP_CPU32_DEFAULT_SPEC "-D__sparclite__"
#define ASM_CPU32_DEFAULT_SPEC "-Asparclite"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite86x
#define CPP_CPU32_DEFAULT_SPEC "-D__sparclite86x__"
#define ASM_CPU32_DEFAULT_SPEC "-Asparclite"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
#define CPP_CPU32_DEFAULT_SPEC "-D__supersparc__ -D__sparc_v8__"
#define ASM_CPU32_DEFAULT_SPEC ""
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_hypersparc
#define CPP_CPU32_DEFAULT_SPEC "-D__hypersparc__ -D__sparc_v8__"
#define ASM_CPU32_DEFAULT_SPEC ""
#endif
2013-07-22 23:41:44 +02:00
#if TARGET_CPU_DEFAULT == TARGET_CPU_leon \
|| TARGET_CPU_DEFAULT == TARGET_CPU_leon3
#define CPP_CPU32_DEFAULT_SPEC "-D__leon__ -D__sparc_v8__"
#define ASM_CPU32_DEFAULT_SPEC AS_LEON_FLAG
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_leon3v7
#define CPP_CPU32_DEFAULT_SPEC "-D__leon__"
#define ASM_CPU32_DEFAULT_SPEC AS_LEONV7_FLAG
#endif
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#endif
#if !defined(CPP_CPU32_DEFAULT_SPEC) || !defined(CPP_CPU64_DEFAULT_SPEC)
#error Unrecognized value in TARGET_CPU_DEFAULT.
#endif
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
#ifdef SPARC_BI_ARCH
#define CPP_CPU_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? "\
%{m64:" CPP_CPU64_DEFAULT_SPEC "} \
%{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
" : "\
%{m32:" CPP_CPU32_DEFAULT_SPEC "} \
%{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
")
#define ASM_CPU_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? "\
%{m64:" ASM_CPU64_DEFAULT_SPEC "} \
%{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
" : "\
%{m32:" ASM_CPU32_DEFAULT_SPEC "} \
%{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
")
#else /* !SPARC_BI_ARCH */
#define CPP_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? CPP_CPU32_DEFAULT_SPEC : CPP_CPU64_DEFAULT_SPEC)
#define ASM_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? ASM_CPU32_DEFAULT_SPEC : ASM_CPU64_DEFAULT_SPEC)
#endif /* !SPARC_BI_ARCH */
/* Define macros to distinguish architectures. */
/* Common CPP definitions used by CPP_SPEC amongst the various targets
for handling -mcpu=xxx switches. */
#define CPP_CPU_SPEC "\
%{mcpu=sparclet:-D__sparclet__} %{mcpu=tsc701:-D__sparclet__} \
%{mcpu=sparclite:-D__sparclite__} \
%{mcpu=f930:-D__sparclite__} %{mcpu=f934:-D__sparclite__} \
%{mcpu=sparclite86x:-D__sparclite86x__} \
%{mcpu=v8:-D__sparc_v8__} \
%{mcpu=supersparc:-D__supersparc__ -D__sparc_v8__} \
%{mcpu=hypersparc:-D__hypersparc__ -D__sparc_v8__} \
%{mcpu=leon:-D__leon__ -D__sparc_v8__} \
2013-07-22 23:41:44 +02:00
%{mcpu=leon3:-D__leon__ -D__sparc_v8__} \
%{mcpu=leon3v7:-D__leon__} \
%{mcpu=v9:-D__sparc_v9__} \
%{mcpu=ultrasparc:-D__sparc_v9__} \
%{mcpu=ultrasparc3:-D__sparc_v9__} \
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
%{mcpu=niagara:-D__sparc_v9__} \
%{mcpu=niagara2:-D__sparc_v9__} \
%{mcpu=niagara3:-D__sparc_v9__} \
%{mcpu=niagara4:-D__sparc_v9__} \
%{!mcpu*:%(cpp_cpu_default)} \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
"
#define CPP_ARCH32_SPEC ""
#define CPP_ARCH64_SPEC "-D__arch64__"
[multiple changes] Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com> * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is defined, emit libcall to __enable_execute_stack. Also fix opcodes and offsets in actual stack trampoline code so they match the commentary and actually work. Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for tmake_file. (sparc64-*-linux): Use t-linux and sparc/t-linux64 for tmake_file. Set extra_parts to needed crt objects. * configure: Rebuilt. * config/sparc/linux64.h (SPARC_BI_ARCH): Define. (TARGET_DEFAULT): Set if default is v9 or ultra. (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, LINK_SPEC, LINK_ARCH_SPEC): Likewise. (TARGET_VERSION): Define. (MULTILIB_DEFAULT): Define. * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define appropriately. (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. * config/sparc/sparc.c (sparc_override_options): If arch and pointer size disagree, emit diagnostic and fix it up. If SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off V8PLUS in 64-bit mode. * config/sparc/t-linux64: New file. * config/sparc/t-sol2-64: New file. * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): Define. (STARTFILE_SPEC): Set approriately based upon those. (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon disposition of DEFAULT_ARCH32_P. (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on arch64/v9. * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. From-SVN: r22565
1998-09-24 04:44:55 +02:00
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define CPP_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? CPP_ARCH32_SPEC : CPP_ARCH64_SPEC)
#define CPP_ARCH_SPEC "\
%{m32:%(cpp_arch32)} \
%{m64:%(cpp_arch64)} \
%{!m32:%{!m64:%(cpp_arch_default)}} \
"
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
/* Macros to distinguish the endianness, window model and FP support. */
#define CPP_OTHER_SPEC "\
%{mflat:-D_FLAT} \
%{msoft-float:-D_SOFT_FLOAT} \
"
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* Macros to distinguish the particular subtarget. */
#define CPP_SUBTARGET_SPEC ""
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define CPP_SPEC \
"%(cpp_cpu) %(cpp_arch) %(cpp_endian) %(cpp_other) %(cpp_subtarget)"
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* This used to translate -dalign to -malign, but that is no good
because it can't turn off the usual meaning of making debugging dumps. */
#define CC1_SPEC ""
/* Override in target specific files. */
#define ASM_CPU_SPEC "\
%{mcpu=sparclet:-Asparclet} %{mcpu=tsc701:-Asparclet} \
%{mcpu=sparclite:-Asparclite} \
%{mcpu=sparclite86x:-Asparclite} \
%{mcpu=f930:-Asparclite} %{mcpu=f934:-Asparclite} \
%{mcpu=v8:-Av8} \
%{mcpu=supersparc:-Av8} \
%{mcpu=hypersparc:-Av8} \
%{mcpu=leon:" AS_LEON_FLAG "} \
%{mcpu=leon3:" AS_LEON_FLAG "} \
%{mcpu=leon3v7:" AS_LEONV7_FLAG "} \
%{mv8plus:-Av8plus} \
%{mcpu=v9:-Av9} \
%{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \
%{mcpu=ultrasparc3:%{!mv8plus:-Av9b}} \
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
%{mcpu=niagara:%{!mv8plus:-Av9b}} \
%{mcpu=niagara2:%{!mv8plus:-Av9b}} \
%{mcpu=niagara3:%{!mv8plus:-Av9" AS_NIAGARA3_FLAG "}} \
Add support for sparc fused compare-and-branch. gcc/ 2012-11-15 David S. Miller <davem@davemloft.net> * configure.ac: Add check for assembler SPARC4 instruction support. * configure: Rebuild. * config.in: Add HAVE_AS_SPARC4 section. * config/sparc/sparc.opt (mcbcond): New option. * doc/invoke.texi: Document it. * config/sparc/constraints.md: New constraint 'A' for 5-bit signed immediates. * doc/md.texi: Document it. * config/sparc/sparc.c (dump_target_flag_bits): Handle MASK_CBCOND. (sparc_option_override): Likewise. (emit_cbcond_insn): New function. (emit_conditional_branch_insn): Call it. (emit_cbcond_nop): New function. (output_ubranch): Use cbcond, remove label arg. (output_cbcond): New function. * config/sparc/sparc-protos.h (output_ubranch): Update. (output_cbcond): Declare it. (emit_cbcond_nop): Likewise. * config/sparc/sparc.md (type attribute): New types 'cbcond' and uncond_cbcond. (emit_cbcond_nop): New attribute. (length attribute): Handle cbcond and uncond_cbcond. (in_call_delay attribute): Reject cbcond and uncond_cbcond. (in_branch_delay attribute): Likewise. (in_uncond_branch_delay attribute): Likewise. (in_annul_branch_delay attribute): Likewise. (*cbcond_sp32, *cbcond_sp64): New insn patterns. (jump): Rewrite into an expander. (*jump_ubranch, *jump_cbcond): New patterns. * config/sparc/niagara4.md: Match 'cbcond' in 'n4_cti'. * config/sparc/sparc.h (AS_NIAGARA4_FLAG): New macro, use it when target default is niagara4. (SPARC_SIMM5_P): Define. * config/sparc/sol2.h (AS_SPARC64_FLAG): Adjust. (AS_SPARC32_FLAG): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Use AS_NIAGARA4_FLAG as needed. From-SVN: r193543
2012-11-15 22:24:22 +01:00
%{mcpu=niagara4:%{!mv8plus:" AS_NIAGARA4_FLAG "}} \
%{!mcpu*:%(asm_cpu_default)} \
"
/* Word size selection, among other things.
This is what GAS uses. Add %(asm_arch) to ASM_SPEC to enable. */
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define ASM_ARCH32_SPEC "-32"
#ifdef HAVE_AS_REGISTER_PSEUDO_OP
#define ASM_ARCH64_SPEC "-64 -no-undeclared-regs"
#else
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define ASM_ARCH64_SPEC "-64"
#endif
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define ASM_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? ASM_ARCH32_SPEC : ASM_ARCH64_SPEC)
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define ASM_ARCH_SPEC "\
%{m32:%(asm_arch32)} \
%{m64:%(asm_arch64)} \
%{!m32:%{!m64:%(asm_arch_default)}} \
"
#ifdef HAVE_AS_RELAX_OPTION
#define ASM_RELAX_SPEC "%{!mno-relax:-relax}"
#else
#define ASM_RELAX_SPEC ""
#endif
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* Special flags to the Sun-4 assembler when using pipe for input. */
#define ASM_SPEC "\
common.opt (R, [...]): New. * common.opt (R, T, Tbss, Tdata, Ttext, h, z): New. * defaults.h (DEFAULT_SWITCH_TAKES_ARG, SWITCH_TAKES_ARG): Remove. (DEFAULT_WORD_SWITCH_TAKES_ARG): Define to 0. * doc/tm.texi.in (SWITCH_TAKES_ARG): Remove. (WORD_SWITCH_TAKES_ARG): Don't refer to SWITCH_TAKES_ARG. Document that options in .opt files do not need to be included. * doc/tm.texi: Regenerate. * gcc.c (LINK_COMMAND_SPEC): Don't include %{x}. * opts-common.c: Update comment on tm.h include. (decode_cmdline_option): Don't use SWITCH_TAKES_ARG. * system.h (SWITCH_TAKES_ARG): Poison. * config/alpha/alpha.h (SWITCH_TAKES_ARG): Remove. * config/darwin.h (WORD_SWITCH_TAKES_ARG): Remove options included in darwin.opt. (LINK_COMMAND_SPEC_A): Don't include %{x}. * config/fr30/fr30.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/freebsd-spec.h (FBSD_SWITCH_TAKES_ARG): Remove. * config/freebsd.h (SWITCH_TAKES_ARG): Remove. * config/frv/frv.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/i386/djgpp.h (LINK_COMMAND_SPEC): Don't include %{x}. * config/ia64/ia64.h (SWITCH_TAKES_ARG): Remove. * config/interix.h (WORD_SWITCH_TAKES_ARG): Don't handle -T options. * config/lm32/lm32.h (SWITCH_TAKES_ARG): Remove. * config/m32r/m32r.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/microblaze/microblaze.h (SWITCH_TAKES_ARG): Remove. * config/mips/mips.h (SWITCH_TAKES_ARG): Remove. * config/mips/netbsd.h (SWITCH_TAKES_ARG): Remove. * config/mips/vxworks.h (SWITCH_TAKES_ARG): Remove. * config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove. * config/netbsd-elf.h (SWITCH_TAKES_ARG): Remove. * config/openbsd.h (SWITCH_TAKES_ARG): Remove. * config/rs6000/sysv4.h (SWITCH_TAKES_ARG): Remove. * config/score/score.h (SWITCH_TAKES_ARG): Remove. * config/sol2.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sp-elf.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sp64-elf.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sparc.h (ASM_SPEC): Don't include %{R}. * config/svr4.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. From-SVN: r166155
2010-11-02 00:40:53 +01:00
%{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \
%(asm_cpu) %(asm_relax)"
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
is an initializer with a subgrouping for each command option.
Each subgrouping contains a string constant, that defines the
2003-09-27 06:48:30 +02:00
specification name, and a string constant that used by the GCC driver
program.
Do not define this macro if it does not need to do anything. */
1992-01-30 21:58:19 +01:00
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define EXTRA_SPECS \
{ "cpp_cpu", CPP_CPU_SPEC }, \
{ "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
{ "cpp_arch32", CPP_ARCH32_SPEC }, \
{ "cpp_arch64", CPP_ARCH64_SPEC }, \
{ "cpp_arch_default", CPP_ARCH_DEFAULT_SPEC },\
{ "cpp_arch", CPP_ARCH_SPEC }, \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
{ "cpp_other", CPP_OTHER_SPEC }, \
{ "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
{ "asm_cpu", ASM_CPU_SPEC }, \
{ "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
{ "asm_arch32", ASM_ARCH32_SPEC }, \
{ "asm_arch64", ASM_ARCH64_SPEC }, \
{ "asm_relax", ASM_RELAX_SPEC }, \
{ "asm_arch_default", ASM_ARCH_DEFAULT_SPEC },\
{ "asm_arch", ASM_ARCH_SPEC }, \
SUBTARGET_EXTRA_SPECS
1992-01-30 21:58:19 +01:00
#define SUBTARGET_EXTRA_SPECS
/* Because libgcc can generate references back to libc (via .umul etc.) we have
to list libc again after the second libgcc. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G %L"
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
#define PTRDIFF_TYPE (TARGET_ARCH64 ? "long int" : "int")
#define SIZE_TYPE (TARGET_ARCH64 ? "long unsigned int" : "unsigned int")
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
/* ??? This should be 32 bits for v9 but what can we do? */
1992-01-30 21:58:19 +01:00
#define WCHAR_TYPE "short unsigned int"
#define WCHAR_TYPE_SIZE 16
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
/* Mask of all CPU selection flags. */
#define MASK_ISA \
(MASK_V8 + MASK_SPARCLITE + MASK_SPARCLET + MASK_V9 + MASK_DEPRECATED_V8_INSNS)
/* TARGET_HARD_MUL: Use hardware multiply instructions but not %y.
TARGET_HARD_MUL32: Use hardware multiply instructions with rd %y
to get high 32 bits. False in V8+ or V9 because multiply stores
a 64-bit result in a register. */
sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. Fri Jan 30 22:30:39 1998 John Carr <jfc@mit.edu> * sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. (output_function_epilogue): Omit epilogue if nothing drops through. (output_move_double): Supress int ldd usage on ultrasparc and v9. (registers_ok_for_ldd_peep): Likewise. (print_operand): Supress b,a on ultrasparc. Let Y accept a constant. (ultrasparc_adjust_cost): New function. (sparc_issue_rate): New function. * sparc.h (MASK_VIS, TARGET_VIS): New (MASK_V8PLUS, TARGET_V8PLUS): New. (TARGET_HARD_MUL32, TARGET_HARD_MUL): New. (TARGET_SWITCHES): Add vis and v8plus. (REG_CLASS_FROM_LETTER): Accept d and b for VIS. (REGISTER_MOVE_COST): FP<->INT move cost 12 for ultrasparc. (RTX_COSTS): Use TARGET_HARD_MUL (ADJUST_COST): Call ultrasparc_adjust_cost. (ISSUE_RATE): New. * sparc.md (attr type): Add sload, fpmove, fpcmove. Adjust users of load & fp appropritely. (supersparc function units): Adjust for Haifa. (ultrasparc function units): Likewise. (get_pc_via_rdpc): All v9, not just arch64. (movdi_v8plus, movdi_v8plus+1): New. (adddi3_sp32+1): New. (subdi3_sp32+1): New. (movsi_insn, movsf_const_insn, movdf_const_insn): Know VIS. (addsi3, subsi3, anddi3_sp32, andsi3, and_not_di_sp32): Likewise. (and_not_si, iordi3_sp32, iorsi3, or_not_di_sp32, or_not_si): Likewise. (xorsi3_sp32, xorsi3, xor_not_di_sp32, xor_not_si): Likewise. (one_cmpldi2_sp32, one_cmplsi2): Likewise. (ldd peepholes): Suppress for v9. (return_adddi): Kill redundant test. Arg1 may be arith_operand. (return_subsi): Revmove. From-SVN: r17560
1998-01-31 00:34:15 +01:00
#define TARGET_HARD_MUL32 \
((TARGET_V8 || TARGET_SPARCLITE \
|| TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS) \
Jakub Jelinek <jj@ultra.linux.cz> * config/sparc/linux64.h (CC1_SPEC): Preserve CPU specified by the user if using the non-default arch size in BI_ARCH configuration. * config/sparc/sol2-sld-64.h (CC1_SPEC): Ditto. * config/sparc/sparc.md (cmp_mul_set, cmp_udiv_cc_set): Fix patterns so that they actually match. (cmp_sdiv_cc_set): Ditto, also don't require g0 to be zero. (mulsidi3_sp64, const_mulsidi3_sp64): New patterns. (const_mulsidi3_sp32): Renamed from const_mulsidi3, only on TARGET_HARD_MUL32. (mulsidi3): Reflect this in the expand. (smulsi3_highpart): Only on TARGET_ARCH32. (umulsidi3_sp64, const_umulsidi3_sp64): New patterns. (const_umulsidi3_sp32): Renamed from const_umulsidi3. (umulsidi3): Reflect this in the expand. (umulsi3_highpart): Only on TARGET_ARCH32. (divsi3_sp32): Renamed from divsi3, only on TARGET_ARCH32, don't require g0 to be zero. (udivsi3_sp32): Renamed from udivsi3, only on TARGET_ARCH32. ({,u}divsi3): New expands. ({,u}divsi3_sp64): New patterns. (after lshrdi3_v8plus): Four new patterns to help combiner optimizing nested mixed mode shifts. * config/sparc/sparc.c (sparc_override_options): Use deprecated v8 instructions if optimizing for UltraSPARC I, II, IIi, as it speed things up. Don't use them by default on plain v9 in 64bit mode, according to what SPAMv9 sais. * config/sparc/sparc.h: Fix comments, e.g. Linux already preserves top 32 bits of %[og][0-7] in signal handlers. Also, TARGET_HARD_MUL32 now is only true for TARGET_ARCH32. From-SVN: r28346
1999-07-30 23:55:06 +02:00
&& ! TARGET_V8PLUS && TARGET_ARCH32)
sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. Fri Jan 30 22:30:39 1998 John Carr <jfc@mit.edu> * sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. (output_function_epilogue): Omit epilogue if nothing drops through. (output_move_double): Supress int ldd usage on ultrasparc and v9. (registers_ok_for_ldd_peep): Likewise. (print_operand): Supress b,a on ultrasparc. Let Y accept a constant. (ultrasparc_adjust_cost): New function. (sparc_issue_rate): New function. * sparc.h (MASK_VIS, TARGET_VIS): New (MASK_V8PLUS, TARGET_V8PLUS): New. (TARGET_HARD_MUL32, TARGET_HARD_MUL): New. (TARGET_SWITCHES): Add vis and v8plus. (REG_CLASS_FROM_LETTER): Accept d and b for VIS. (REGISTER_MOVE_COST): FP<->INT move cost 12 for ultrasparc. (RTX_COSTS): Use TARGET_HARD_MUL (ADJUST_COST): Call ultrasparc_adjust_cost. (ISSUE_RATE): New. * sparc.md (attr type): Add sload, fpmove, fpcmove. Adjust users of load & fp appropritely. (supersparc function units): Adjust for Haifa. (ultrasparc function units): Likewise. (get_pc_via_rdpc): All v9, not just arch64. (movdi_v8plus, movdi_v8plus+1): New. (adddi3_sp32+1): New. (subdi3_sp32+1): New. (movsi_insn, movsf_const_insn, movdf_const_insn): Know VIS. (addsi3, subsi3, anddi3_sp32, andsi3, and_not_di_sp32): Likewise. (and_not_si, iordi3_sp32, iorsi3, or_not_di_sp32, or_not_si): Likewise. (xorsi3_sp32, xorsi3, xor_not_di_sp32, xor_not_si): Likewise. (one_cmpldi2_sp32, one_cmplsi2): Likewise. (ldd peepholes): Suppress for v9. (return_adddi): Kill redundant test. Arg1 may be arith_operand. (return_subsi): Revmove. From-SVN: r17560
1998-01-31 00:34:15 +01:00
#define TARGET_HARD_MUL \
(TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET \
|| TARGET_DEPRECATED_V8_INSNS || TARGET_V8PLUS)
sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. Fri Jan 30 22:30:39 1998 John Carr <jfc@mit.edu> * sparc.c (sparc_override_options): Make v8plus and ultrasparc set MASK_V8PLUS. (output_function_epilogue): Omit epilogue if nothing drops through. (output_move_double): Supress int ldd usage on ultrasparc and v9. (registers_ok_for_ldd_peep): Likewise. (print_operand): Supress b,a on ultrasparc. Let Y accept a constant. (ultrasparc_adjust_cost): New function. (sparc_issue_rate): New function. * sparc.h (MASK_VIS, TARGET_VIS): New (MASK_V8PLUS, TARGET_V8PLUS): New. (TARGET_HARD_MUL32, TARGET_HARD_MUL): New. (TARGET_SWITCHES): Add vis and v8plus. (REG_CLASS_FROM_LETTER): Accept d and b for VIS. (REGISTER_MOVE_COST): FP<->INT move cost 12 for ultrasparc. (RTX_COSTS): Use TARGET_HARD_MUL (ADJUST_COST): Call ultrasparc_adjust_cost. (ISSUE_RATE): New. * sparc.md (attr type): Add sload, fpmove, fpcmove. Adjust users of load & fp appropritely. (supersparc function units): Adjust for Haifa. (ultrasparc function units): Likewise. (get_pc_via_rdpc): All v9, not just arch64. (movdi_v8plus, movdi_v8plus+1): New. (adddi3_sp32+1): New. (subdi3_sp32+1): New. (movsi_insn, movsf_const_insn, movdf_const_insn): Know VIS. (addsi3, subsi3, anddi3_sp32, andsi3, and_not_di_sp32): Likewise. (and_not_si, iordi3_sp32, iorsi3, or_not_di_sp32, or_not_si): Likewise. (xorsi3_sp32, xorsi3, xor_not_di_sp32, xor_not_si): Likewise. (one_cmpldi2_sp32, one_cmplsi2): Likewise. (ldd peepholes): Suppress for v9. (return_adddi): Kill redundant test. Arg1 may be arith_operand. (return_subsi): Revmove. From-SVN: r17560
1998-01-31 00:34:15 +01:00
/* MASK_APP_REGS must always be the default because that's what
FIXED_REGISTERS is set to and -ffixed- is processed before
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
TARGET_CONDITIONAL_REGISTER_USAGE is called (where we process
-mno-app-regs). */
#define TARGET_DEFAULT (MASK_APP_REGS + MASK_FPU)
/* Recast the cpu class to be the cpu attribute.
Every file includes us, but not every file includes insn-attr.h. */
#define sparc_cpu_attr ((enum attr_cpu) sparc_cpu)
/* Support for a compile-time default CPU, et cetera. The rules are:
--with-cpu is ignored if -mcpu is specified.
--with-tune is ignored if -mtune is specified.
--with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
are specified. */
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
{"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
/* target machine storage layout */
1992-01-30 21:58:19 +01:00
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields. */
#define BITS_BIG_ENDIAN 1
/* Define this if most significant byte of a word is the lowest numbered. */
#define BYTES_BIG_ENDIAN 1
/* Define this if most significant word of a multiword number is the lowest
numbered. */
#define WORDS_BIG_ENDIAN 1
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define MAX_BITS_PER_WORD 64
1992-01-30 21:58:19 +01:00
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD (TARGET_ARCH64 ? 8 : 4)
#ifdef IN_LIBGCC2
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#else
#define MIN_UNITS_PER_WORD 4
#endif
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
/* Now define the sizes of the C data types. */
#define SHORT_TYPE_SIZE 16
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
#define INT_TYPE_SIZE 32
#define LONG_TYPE_SIZE (TARGET_ARCH64 ? 64 : 32)
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define LONG_LONG_TYPE_SIZE 64
#define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 64
/* LONG_DOUBLE_TYPE_SIZE is defined per OS even though the
SPARC ABI says that it is 128-bit wide. */
/* #define LONG_DOUBLE_TYPE_SIZE 128 */
1992-01-30 21:58:19 +01:00
/* The widest floating-point format really supported by the hardware. */
#define WIDEST_HARDWARE_FP_SIZE 64
/* Width in bits of a pointer. This is the size of ptr_mode. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define POINTER_SIZE (TARGET_PTR64 ? 64 : 32)
1992-01-30 21:58:19 +01:00
/* This is the machine mode used for addresses. */
#define Pmode (TARGET_ARCH64 ? DImode : SImode)
/* If we have to extend pointers (only when TARGET_ARCH64 and not
TARGET_PTR64), we want to do it unsigned. This macro does nothing
if ptr_mode and Pmode are the same. */
#define POINTERS_EXTEND_UNSIGNED 1
1992-01-30 21:58:19 +01:00
/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY (TARGET_ARCH64 ? 64 : 32)
1992-01-30 21:58:19 +01:00
/* Boundary (in *bits*) on which stack pointer should be aligned. */
/* FIXME, this is wrong when TARGET_ARCH64 and TARGET_STACK_BIAS, because
then %sp+2047 is 128-bit aligned so %sp is really only byte-aligned. */
#define STACK_BOUNDARY (TARGET_ARCH64 ? 128 : 64)
/* Temporary hack until the FIXME above is fixed. */
#define SPARC_STACK_BOUNDARY_HACK (TARGET_ARCH64 && TARGET_STACK_BIAS)
1992-01-30 21:58:19 +01:00
/* ALIGN FRAMES on double word boundaries */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define SPARC_STACK_ALIGN(LOC) \
(TARGET_ARCH64 ? (((LOC)+15) & ~15) : (((LOC)+7) & ~7))
1992-01-30 21:58:19 +01:00
/* Allocation boundary (in *bits*) for the code of a function. */
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
#define FUNCTION_BOUNDARY 32
1992-01-30 21:58:19 +01:00
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY (TARGET_ARCH64 ? 64 : 32)
1992-01-30 21:58:19 +01:00
/* Every structure's size must be a multiple of this. */
#define STRUCTURE_SIZE_BOUNDARY 8
/* A bit-field declared as `int' forces `int' alignment for the struct. */
1992-01-30 21:58:19 +01:00
#define PCC_BITFIELD_TYPE_MATTERS 1
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64)
1992-01-30 21:58:19 +01:00
1992-06-03 22:40:18 +02:00
/* The best alignment to use in cases where we have a choice. */
#define FASTEST_ALIGNMENT 64
/* Define this macro as an expression for the alignment of a structure
(given by STRUCT as a tree node) if the alignment computed in the
usual way is COMPUTED and the alignment explicitly specified was
SPECIFIED.
The default is to use SPECIFIED if it is larger; otherwise, use
the smaller of COMPUTED and `BIGGEST_ALIGNMENT' */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
(TARGET_FASTER_STRUCTS ? \
((TREE_CODE (STRUCT) == RECORD_TYPE \
|| TREE_CODE (STRUCT) == UNION_TYPE \
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
&& TYPE_FIELDS (STRUCT) != 0 \
? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \
: MAX ((COMPUTED), (SPECIFIED))) \
: MAX ((COMPUTED), (SPECIFIED)))
/* An integer expression for the size in bits of the largest integer machine
mode that should actually be used. We allow pairs of registers. */
#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_ARCH64 ? TImode : DImode)
/* We need 2 words, so we can save the stack pointer and the return register
of the function containing a non-local goto target. */
#define STACK_SAVEAREA_MODE(LEVEL) \
((LEVEL) == SAVE_NONLOCAL ? (TARGET_ARCH64 ? TImode : DImode) : Pmode)
1992-01-30 21:58:19 +01:00
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
((TREE_CODE (EXP) == STRING_CST \
&& (ALIGN) < FASTEST_ALIGNMENT) \
? FASTEST_ALIGNMENT : (ALIGN))
1992-01-30 21:58:19 +01:00
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
(TREE_CODE (TYPE) == ARRAY_TYPE \
&& TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
1992-06-03 22:40:18 +02:00
&& (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
1992-01-30 21:58:19 +01:00
/* Make local arrays of chars word-aligned for the same reasons. */
#define LOCAL_ALIGNMENT(TYPE, ALIGN) DATA_ALIGNMENT (TYPE, ALIGN)
/* Set this nonzero if move instructions will actually fail to work
1992-01-30 21:58:19 +01:00
when given unaligned data. */
#define STRICT_ALIGNMENT 1
1992-01-30 21:58:19 +01:00
/* Things that must be doubleword aligned cannot go in the text section,
because the linker fails to align the text section enough!
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
Put them in the data section. This macro is only used in this file. */
1992-01-30 21:58:19 +01:00
#define MAX_TEXT_ALIGN 32
/* Standard register usage. */
/* Number of actual hardware registers.
The hardware registers are assigned numbers for the compiler
from 0 to just below FIRST_PSEUDO_REGISTER.
All registers that the compiler knows about must be given numbers,
even those that are not normally considered general registers.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
SPARC has 32 integer registers and 32 floating point registers.
64-bit SPARC has 32 additional fp regs, but the odd numbered ones are not
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
accessible. We still account for them to simplify register computations
(e.g.: in CLASS_MAX_NREGS). There are also 4 fp condition code registers, so
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
32+32+32+4 == 100.
Register 100 is used as the integer condition code register.
Register 101 is used as the soft frame pointer register. */
1992-01-30 21:58:19 +01:00
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
#define FIRST_PSEUDO_REGISTER 103
#define SPARC_FIRST_INT_REG 0
#define SPARC_LAST_INT_REG 31
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
#define SPARC_FIRST_FP_REG 32
/* Additional V9 fp regs. */
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
#define SPARC_FIRST_V9_FP_REG 64
#define SPARC_LAST_V9_FP_REG 95
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
/* V9 %fcc[0123]. V8 uses (figuratively) %fcc0. */
#define SPARC_FIRST_V9_FCC_REG 96
#define SPARC_LAST_V9_FCC_REG 99
/* V8 fcc reg. */
#define SPARC_FCC_REG 96
/* Integer CC reg. We don't distinguish %icc from %xcc. */
#define SPARC_ICC_REG 100
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
#define SPARC_GSR_REG 102
1992-01-30 21:58:19 +01:00
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
/* Nonzero if REGNO is an fp reg. */
#define SPARC_FP_REG_P(REGNO) \
((REGNO) >= SPARC_FIRST_FP_REG && (REGNO) <= SPARC_LAST_V9_FP_REG)
/* Nonzero if REGNO is an int reg. */
#define SPARC_INT_REG_P(REGNO) \
(((unsigned) (REGNO)) <= SPARC_LAST_INT_REG)
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
/* Argument passing regs. */
#define SPARC_OUTGOING_INT_ARG_FIRST 8
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define SPARC_INCOMING_INT_ARG_FIRST (TARGET_FLAT ? 8 : 24)
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
#define SPARC_FP_ARG_FIRST 32
1992-01-30 21:58:19 +01:00
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
On non-v9 systems:
g1 is free to use as temporary.
g2-g4 are reserved for applications. Gcc normally uses them as
temporaries, but this can be disabled via the -mno-app-regs option.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
g5 through g7 are reserved for the operating system.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
On v9 systems:
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
g1,g5 are free to use as temporaries, and are free to use between calls
if the call is to an external function via the PLT.
g4 is free to use as a temporary in the non-embedded case.
g4 is reserved in the embedded case.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
g2-g3 are reserved for applications. Gcc normally uses them as
temporaries, but this can be disabled via the -mno-app-regs option.
sparc.h (SPARC_V9,SPARC_ARCH64): Delete. * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. (DEFAULT_ARCH32_P): New macro. (TARGET_ARCH{32,64}): Allow compile time or runtime selection. (enum cmodel): Declare. (sparc_cmodel_string,sparc_cmodel): Declare. (SPARC_DEFAULT_CMODEL): Provide default. (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. (TARGET_FULLANY): Deleted. (TARGET_CM_MEDMID): New macro. (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). (CPP_SPEC): Rewrite. (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. (ASM_SPEC): Add %(asm_arch). (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. Rename asm_default to asm_cpu_default. Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. (MASK_INT64,MASK_LONG64): Delete. (MASK_ARCH64): Renamed to MASK_64BIT. (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. (TARGET_SWITCHES): Always provide 64 bit options. (ARCH64_SWITCHES): Delete. (TARGET_OPTIONS): New option -mcmodel=. (INT_TYPE_SIZE): Always 32. (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. * sparc/linux.h: Likewise. * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (LONG_DOUBLE_TYPE_SIZE): Define. (ASM_SPEC): Add %(asm_arch). * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (TARGET_CPU_DEFAULT): Add ultrasparc case. * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. (SPARC_DEFAULT_CMODEL): Define. * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete MASK_LONG64, MASK_MEDANY. (SPARC_DEFAULT_CMODEL): Define. (CPP_PREDEFINES): Delete. (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. (ASM_SPEC): Add %(asm_arch). (LONG_DOUBLE_TYPE_SIZE): Define. (DWARF2_DEBUGGING_INFO): Define. * sparc/splet.h (CPP_SPEC): Delete. * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. (BLOCK_PROFILER): Likewise. * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. (sparc_override_options): Handle code model selection. (sparc_init_expanders): Renamed from sparc64_init_expanders. * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_.... TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... (sethi_di_fullany): Delete. From-SVN: r16108
1997-10-20 22:49:22 +02:00
g6-g7 are reserved for the operating system (or application in
embedded case).
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
??? Register 1 is used as a temporary by the 64 bit sethi pattern, so must
currently be a fixed register until this pattern is rewritten.
Register 1 is also used when restoring call-preserved registers in large
stack frames.
Registers fixed in arch32 and not arch64 (or vice-versa) are marked in
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
TARGET_CONDITIONAL_REGISTER_USAGE in order to properly handle -ffixed-.
*/
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define FIXED_REGISTERS \
{1, 0, 2, 2, 2, 2, 1, 1, \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
0, 0, 0, 0, 0, 0, 1, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
0, 0, 0, 0, 0, 0, 0, 1, \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
\
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
\
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
\
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
0, 0, 0, 0, 0, 1, 1}
1992-01-30 21:58:19 +01:00
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
registers that can be used without being saved.
The latter must include the registers where values are returned
and the register where structure-value addresses are passed.
Aside from that, you can include as many other registers as you like. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define CALL_USED_REGISTERS \
{1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
0, 0, 0, 0, 0, 0, 0, 1, \
\
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
\
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, \
\
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
1, 1, 1, 1, 1, 1, 1}
1992-01-30 21:58:19 +01:00
/* Return number of consecutive hard regs needed starting at reg REGNO
to hold something of mode MODE.
This is ordinarily the length in words of a value of mode MODE
but can be less for certain modes in special long registers.
On SPARC, ordinary registers hold 32 bits worth;
this means both integer and floating point registers.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
On v9, integer regs hold 64 bits worth; floating point regs hold
32 bits worth (this includes the new fp regs as even the odd ones are
included in the hard register count). */
1992-01-30 21:58:19 +01:00
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define HARD_REGNO_NREGS(REGNO, MODE) \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
((REGNO) == SPARC_GSR_REG ? 1 : \
(TARGET_ARCH64 \
? (SPARC_INT_REG_P (REGNO) || (REGNO) == FRAME_POINTER_REGNUM \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD \
: (GET_MODE_SIZE (MODE) + 3) / 4) \
: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)))
1992-01-30 21:58:19 +01:00
/* Due to the ARCH64 discrepancy above we must override this next
macro too. */
#define REGMODE_NATURAL_SIZE(MODE) sparc_regmode_natural_size (MODE)
1992-01-30 21:58:19 +01:00
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
See sparc.c for how we initialize this. */
extern const int *hard_regno_mode_classes;
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
extern int sparc_mode_class[];
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
/* ??? Because of the funny way we pass parameters we should allow certain
??? types of float/complex values to be in integer registers during
??? RTL generation. This only matters on arch32. */
1992-01-30 21:58:19 +01:00
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
((hard_regno_mode_classes[REGNO] & sparc_mode_class[MODE]) != 0)
1992-01-30 21:58:19 +01:00
/* Value is 1 if it is OK to rename a hard register FROM to another hard
register TO. We cannot rename %g1 as it may be used before the save
register window instruction in the prologue. */
#define HARD_REGNO_RENAME_OK(FROM, TO) ((FROM) != 1)
#define MODES_TIEABLE_P(MODE1, MODE2) sparc_modes_tieable_p (MODE1, MODE2)
1992-01-30 21:58:19 +01:00
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
/* Register to use for pushing function arguments. */
#define STACK_POINTER_REGNUM 14
/* The stack bias (amount by which the hardware register is offset by). */
#define SPARC_STACK_BIAS ((TARGET_ARCH64 && TARGET_STACK_BIAS) ? 2047 : 0)
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
/* Actual top-of-stack address is 92/176 greater than the contents of the
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
stack pointer register for !v9/v9. That is:
- !v9: 64 bytes for the in and local registers, 4 bytes for structure return
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
address, and 6*4 bytes for the 6 register parameters.
- v9: 128 bytes for the in and local registers + 6*8 bytes for the integer
parameter regs. */
#define STACK_POINTER_OFFSET (FIRST_PARM_OFFSET(0) + SPARC_STACK_BIAS)
1992-01-30 21:58:19 +01:00
/* Base register for access to local variables of the function. */
#define HARD_FRAME_POINTER_REGNUM 30
/* The soft frame pointer does not have the stack bias applied. */
#define FRAME_POINTER_REGNUM 101
/* Given the stack bias, the stack pointer isn't actually aligned. */
#define INIT_EXPANDERS \
do { \
if (crtl->emit.regno_pointer_align && SPARC_STACK_BIAS) \
{ \
REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = BITS_PER_UNIT; \
REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT; \
} \
} while (0)
1992-01-30 21:58:19 +01:00
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
1992-01-30 21:58:19 +01:00
/* Register in which static-chain is passed to a function. This must
not be a register used by the prologue. */
#define STATIC_CHAIN_REGNUM (TARGET_ARCH64 ? 5 : 2)
1992-01-30 21:58:19 +01:00
/* Register which holds the global offset table, if any. */
#define GLOBAL_OFFSET_TABLE_REGNUM 23
1992-01-30 21:58:19 +01:00
/* Register which holds offset table for position-independent
data references. */
#define PIC_OFFSET_TABLE_REGNUM \
(flag_pic ? GLOBAL_OFFSET_TABLE_REGNUM : INVALID_REGNUM)
1992-01-30 21:58:19 +01:00
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
/* Pick a default value we can notice from override_options:
!v9: Default is on.
v9: Default is off.
Originally it was -1, but later on the container of options changed to
unsigned byte, so we decided to pick 127 as default value, which does
reflect an undefined default value in case of 0/1. */
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
#define DEFAULT_PCC_STRUCT_RETURN 127
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
1992-01-30 21:58:19 +01:00
/* Functions which return large structures get the address
to place the wanted value at offset 64 from the frame.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
Must reserve 64 bytes for the in and local registers.
v9: Functions which return large structures get the address to place the
wanted value from an invisible first argument. */
1992-01-30 21:58:19 +01:00
#define STRUCT_VALUE_OFFSET 64
/* Define the classes of registers for register constraints in the
machine description. Also define ranges of constants.
One of the classes must always be named ALL_REGS and include all hard regs.
If there is more than one class, another class must be named NO_REGS
and contain no registers.
The name GENERAL_REGS must be the name of a class (or an alias for
another name such as ALL_REGS). This is the class of registers
that is allowed by "g" or "r" in a register constraint.
Also, registers outside this class are allocated only when
instructions express preferences for them.
The classes must be numbered in nondecreasing order; that is,
a larger-numbered class must never be contained completely
in a smaller-numbered class.
For any two classes, it is very desirable that there be another
class that represents their union. */
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
/* The SPARC has various kinds of registers: general, floating point,
and condition codes [well, it has others as well, but none that we
care directly about].
For v9 we must distinguish between the upper and lower floating point
registers because the upper ones can't hold SFmode values.
HARD_REGNO_MODE_OK won't help here because reload assumes that register(s)
satisfying a group need for a class will also satisfy a single need for
that class. EXTRA_FP_REGS is a bit of a misnomer as it covers all 64 fp
regs.
It is important that one class contains all the general and all the standard
fp regs. Otherwise find_reg() won't properly allocate int regs for moves,
because reg_class_record() will bias the selection in favor of fp regs,
because reg_class_subunion[GENERAL_REGS][FP_REGS] will yield FP_REGS,
because FP_REGS > GENERAL_REGS.
It is also important that one class contain all the general and all
the fp regs. Otherwise when spilling a DFmode reg, it may be from
EXTRA_FP_REGS but find_reloads() may use class
GENERAL_OR_FP_REGS. This will cause allocate_reload_reg() to die
because the compiler thinks it doesn't have a spill reg when in
fact it does.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
v9 also has 4 floating point condition code registers. Since we don't
have a class that is the union of FPCC_REGS with either of the others,
it is important that it appear first. Otherwise the compiler will die
trying to compile _fixunsdfsi because fix_truncdfsi2 won't match its
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
constraints.
It is important that SPARC_ICC_REG have class NO_REGS. Otherwise combine
may try to use it to hold an SImode value. See register_operand.
1997-12-07 01:31:01 +01:00
??? Should %fcc[0123] be handled similarly?
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
*/
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS,
EXTRA_FP_REGS, GENERAL_OR_FP_REGS, GENERAL_OR_EXTRA_FP_REGS,
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
ALL_REGS, LIM_REG_CLASSES };
1992-01-30 21:58:19 +01:00
#define N_REG_CLASSES (int) LIM_REG_CLASSES
/* Give names of register classes as strings for dump file. */
1992-01-30 21:58:19 +01:00
#define REG_CLASS_NAMES \
{ "NO_REGS", "FPCC_REGS", "I64_REGS", "GENERAL_REGS", "FP_REGS", \
"EXTRA_FP_REGS", "GENERAL_OR_FP_REGS", "GENERAL_OR_EXTRA_FP_REGS", \
"ALL_REGS" }
1992-01-30 21:58:19 +01:00
/* Define which registers fit in which classes.
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS \
{{0, 0, 0, 0}, /* NO_REGS */ \
{0, 0, 0, 0xf}, /* FPCC_REGS */ \
{0xffff, 0, 0, 0}, /* I64_REGS */ \
{-1, 0, 0, 0x20}, /* GENERAL_REGS */ \
{0, -1, 0, 0}, /* FP_REGS */ \
{0, -1, -1, 0}, /* EXTRA_FP_REGS */ \
{-1, -1, 0, 0x20}, /* GENERAL_OR_FP_REGS */ \
{-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */ \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
{-1, -1, -1, 0x7f}} /* ALL_REGS */
1992-01-30 21:58:19 +01:00
/* The same information, inverted:
Return the class number of the smallest class containing
reg number REGNO. This could be a conditional expression
or could index an array. */
extern enum reg_class sparc_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) sparc_regno_reg_class[(REGNO)]
/* Defines invalid mode changes. Borrowed from the PA port.
SImode loads to floating-point registers are not zero-extended.
The definition for LOAD_EXTEND_OP specifies that integer loads
narrower than BITS_PER_WORD will be zero-extended. As a result,
we inhibit changes from SImode unless they are to a mode that is
identical in size.
Likewise for SFmode, since word-mode paradoxical subregs are
problematic on big-endian architectures. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
(TARGET_ARCH64 \
&& GET_MODE_SIZE (FROM) == 4 \
&& GET_MODE_SIZE (TO) != 4 \
? reg_classes_intersect_p (CLASS, FP_REGS) : 0)
/* This is the order in which to allocate registers normally.
We put %f0-%f7 last among the float registers, so as to make it more
likely that a pseudo-register which dies in the float return register
area will get allocated to the float return register, thus saving a move
instruction at the end of the function.
Similarly for integer return value registers.
We know in this case that we will not end up with a leaf function.
The register allocator is given the global and out registers first
because these registers are call clobbered and thus less useful to
global register allocation.
Next we list the local and in registers. They are not call clobbered
and thus very useful for global register allocation. We list the input
registers before the locals so that it is more likely the incoming
arguments received in those registers can just stay there and not be
reloaded. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define REG_ALLOC_ORDER \
{ 1, 2, 3, 4, 5, 6, 7, /* %g1-%g7 */ \
13, 12, 11, 10, 9, 8, /* %o5-%o0 */ \
15, /* %o7 */ \
16, 17, 18, 19, 20, 21, 22, 23, /* %l0-%l7 */ \
29, 28, 27, 26, 25, 24, 31, /* %i5-%i0,%i7 */\
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
40, 41, 42, 43, 44, 45, 46, 47, /* %f8-%f15 */ \
48, 49, 50, 51, 52, 53, 54, 55, /* %f16-%f23 */ \
56, 57, 58, 59, 60, 61, 62, 63, /* %f24-%f31 */ \
64, 65, 66, 67, 68, 69, 70, 71, /* %f32-%f39 */ \
72, 73, 74, 75, 76, 77, 78, 79, /* %f40-%f47 */ \
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
80, 81, 82, 83, 84, 85, 86, 87, /* %f48-%f55 */ \
88, 89, 90, 91, 92, 93, 94, 95, /* %f56-%f63 */ \
39, 38, 37, 36, 35, 34, 33, 32, /* %f7-%f0 */ \
96, 97, 98, 99, /* %fcc0-3 */ \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
100, 0, 14, 30, 101, 102 } /* %icc, %g0, %o6, %i6, %sfp, %gsr */
1992-01-30 21:58:19 +01:00
/* This is the order in which to allocate registers for
leaf functions. If all registers can fit in the global and
output registers, then we have the possibility of having a leaf
function.
The macro actually mentioned the input registers first,
because they get renumbered into the output registers once
we know really do have a leaf function.
To be more precise, this register allocation order is used
when %o7 is found to not be clobbered right before register
allocation. Normally, the reason %o7 would be clobbered is
due to a call which could not be transformed into a sibling
call.
As a consequence, it is possible to use the leaf register
allocation order and not end up with a leaf function. We will
not get suboptimal register allocation in that case because by
definition of being potentially leaf, there were no function
calls. Therefore, allocation order within the local register
window is not critical like it is when we do have function calls. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define REG_LEAF_ALLOC_ORDER \
{ 1, 2, 3, 4, 5, 6, 7, /* %g1-%g7 */ \
29, 28, 27, 26, 25, 24, /* %i5-%i0 */ \
15, /* %o7 */ \
13, 12, 11, 10, 9, 8, /* %o5-%o0 */ \
16, 17, 18, 19, 20, 21, 22, 23, /* %l0-%l7 */ \
40, 41, 42, 43, 44, 45, 46, 47, /* %f8-%f15 */ \
48, 49, 50, 51, 52, 53, 54, 55, /* %f16-%f23 */ \
56, 57, 58, 59, 60, 61, 62, 63, /* %f24-%f31 */ \
64, 65, 66, 67, 68, 69, 70, 71, /* %f32-%f39 */ \
72, 73, 74, 75, 76, 77, 78, 79, /* %f40-%f47 */ \
80, 81, 82, 83, 84, 85, 86, 87, /* %f48-%f55 */ \
88, 89, 90, 91, 92, 93, 94, 95, /* %f56-%f63 */ \
39, 38, 37, 36, 35, 34, 33, 32, /* %f7-%f0 */ \
96, 97, 98, 99, /* %fcc0-3 */ \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
100, 0, 14, 30, 31, 101, 102 } /* %icc, %g0, %o6, %i6, %i7, %sfp, %gsr */
#define ADJUST_REG_ALLOC_ORDER order_regs_for_local_alloc ()
1992-01-30 21:58:19 +01:00
sibcall.c (skip_copy_to_return_value): Use OUTGOING_REGNO for comparison if regno's are equal. * sibcall.c (skip_copy_to_return_value): Use OUTGOING_REGNO for comparison if regno's are equal. * calls.c (initialize_argument_informat): Add ecf_flags argument. Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. (expand_call): Update caller. Avoid making a sibling call if argument size of the callee is larger than argument size of the caller. Call hard_function_value with outgoing set if in sibcall pass. Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. * final.c (permitted_reg_in_leaf_functions, only_leaf_regs_used): Change LEAF_REGISTERS from an array initializer to actual array identifier. Move static global variable into the function. (leaf_function_p): Allow SIBLING_CALL_P calls even outside of sequences for leaf functions. * global.c (global_alloc): Likewise. * tm.texi (LEAF_REGISTERS): Update documentation. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Remove the ugly TARGET_FLAT leaf disabling hack. (LEAF_REGISTERS): Changed from an array initializer to actual array identifier to avoid duplication and remove the above hack. (FUNCTION_OK_FOR_SIBCALL): Define. * config/sparc/sparc.md (sibcall): New attr type. Use it almost always like call attribute. (eligible_for_sibcall_delay): New attribute. (sibcall): New delay type. (sibcall, sibcall_value, sibcall_epilogue): New expands. (sibcall_symbolic_sp32, sibcall_symbolic_sp64, sibcall_value_symbolic_sp32, sibcall_value_symbolic_sp64): New insns. * config/sparc/sparc.c (sparc_leaf_regs): New array. (eligible_for_sibcall_delay, output_restore_regs, output_sibcall): New functions. (output_function_epilogue): Move part of the code into output_restore_regs. (ultra_code_from_mask, ultrasparc_sched_reorder): Handle TYPE_SIBCALL. * sparc-protos.h (output_sibcall, eligible_for_sibcall_delay): New prototypes. From-SVN: r32730
2000-03-24 22:48:01 +01:00
extern char sparc_leaf_regs[];
#define LEAF_REGISTERS sparc_leaf_regs
1992-01-30 21:58:19 +01:00
extern char leaf_reg_remap[];
1992-01-30 21:58:19 +01:00
#define LEAF_REG_REMAP(REGNO) (leaf_reg_remap[REGNO])
/* The class value for index registers, and the one for base regs. */
#define INDEX_REG_CLASS GENERAL_REGS
#define BASE_REG_CLASS GENERAL_REGS
/* Local macro to handle the two v9 classes of FP regs. */
#define FP_REG_CLASS_P(CLASS) ((CLASS) == FP_REGS || (CLASS) == EXTRA_FP_REGS)
Add support for sparc fused compare-and-branch. gcc/ 2012-11-15 David S. Miller <davem@davemloft.net> * configure.ac: Add check for assembler SPARC4 instruction support. * configure: Rebuild. * config.in: Add HAVE_AS_SPARC4 section. * config/sparc/sparc.opt (mcbcond): New option. * doc/invoke.texi: Document it. * config/sparc/constraints.md: New constraint 'A' for 5-bit signed immediates. * doc/md.texi: Document it. * config/sparc/sparc.c (dump_target_flag_bits): Handle MASK_CBCOND. (sparc_option_override): Likewise. (emit_cbcond_insn): New function. (emit_conditional_branch_insn): Call it. (emit_cbcond_nop): New function. (output_ubranch): Use cbcond, remove label arg. (output_cbcond): New function. * config/sparc/sparc-protos.h (output_ubranch): Update. (output_cbcond): Declare it. (emit_cbcond_nop): Likewise. * config/sparc/sparc.md (type attribute): New types 'cbcond' and uncond_cbcond. (emit_cbcond_nop): New attribute. (length attribute): Handle cbcond and uncond_cbcond. (in_call_delay attribute): Reject cbcond and uncond_cbcond. (in_branch_delay attribute): Likewise. (in_uncond_branch_delay attribute): Likewise. (in_annul_branch_delay attribute): Likewise. (*cbcond_sp32, *cbcond_sp64): New insn patterns. (jump): Rewrite into an expander. (*jump_ubranch, *jump_cbcond): New patterns. * config/sparc/niagara4.md: Match 'cbcond' in 'n4_cti'. * config/sparc/sparc.h (AS_NIAGARA4_FLAG): New macro, use it when target default is niagara4. (SPARC_SIMM5_P): Define. * config/sparc/sol2.h (AS_SPARC64_FLAG): Adjust. (AS_SPARC32_FLAG): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Use AS_NIAGARA4_FLAG as needed. From-SVN: r193543
2012-11-15 22:24:22 +01:00
/* Predicates for 5-bit, 10-bit, 11-bit and 13-bit signed constants. */
#define SPARC_SIMM5_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x10 < 0x20)
#define SPARC_SIMM10_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x200 < 0x400)
#define SPARC_SIMM11_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x400 < 0x800)
#define SPARC_SIMM13_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x1000 < 0x2000)
sparc.c (reg_or_0_operand, [...]): Delete. * config/sparc/sparc.c (reg_or_0_operand, const1_operand, fp_zero_operand, fp_register_operand, intreg_operand, fcc_reg_operand, fcc0_reg_operand, icc_or_fcc_reg_operand, call_operand, call_operand_address, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand, symbolic_operand, symbolic_memory_operand, label_ref_operand, sp64_medium_pic_operand, data_segment_operand, text_segment_operand, splittable_symbolic_memory_operand, reg_or_nonsymb_mem_operand, splittable_immediate_memory_operand, eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, extend_op, cc_arithop, cc_arithopn, arith_operand, arith_4096_operand, arith_add_operand, const64_operand, const64_high_operand, arith11_operand, arith10_operand, arith_double_operand, arith_double_4096_operand, arith_double_add_operand, arith11_double_operand, arith10_double_operand, small_int, small_int_or_double, uns_small_int, uns_arith_operand, clobbered_register, input_operand, compare_operand): Delete. (sparc_emit_set_const32): Use predicates in assertion. Remove special code for TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT != 64. (sparc_emit_set_const64): Call gcc_unreachable if H_B_P_W_I == 32. (GEN_HIGHINT64, GEN_INT64): Delete. (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, gen_safe_XOR64): Adjust for above deletion. (sparc_emit_set_const64): Support only H_B_P_W_I == 64 and CONST_INTs. Use 'unsigned HOST_WIDE_INT' instead of 'long' for bitmask. (legitimate_constant_p): Use const_zero_operand instead. (sparc_extra_constraint_check): Likewise. * config/sparc/sparc.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'O'. (PREFERRED_RELOAD_CLASS): Use const_zero_operand. (PREDICATE_CODES): Delete. * config/sparc/sparc.md: Include predicates.md. (All patterns): Adjust for new predicate names. (cmpdi, cmpdi_sp64): Use arith_operand predicate. (movhi_const64_special, movsi_const64_special): Add 'K' constraint. (movdi): Use general_operand predicate. (movdi_sp64_dbl): Delete. (movdi_const64_special): Add 'N' constraint. (movdicc): Use arith10_operand predicate. (movdi_cc_sp64, movdi_cc_sp64_trunc): Use arith11_operand predicate. (movdi_cc_reg_sp64): Use arith10_operand predicate. (movdi_cc_reg_sp64_trunc): Delete. (cmp_zero_extract, cmp_zero_extract_sp64): Use small_int_operand. (adddi3_insn_sp32, addx, cmp_cc_plus, cmp_ccx_plus, cmp_cc_plus_set, cmp_ccx_plus_set): Use register_operand predicate. (adddi3_sp64, cmp_ccx_plus_set): Use arith_operand predicate. (subdi3_sp32): Delete. (subdi3_insn_sp32): Change to define_insn_and_split. (subdi3_sp64, cmp_minus_ccx, cmp_minus_ccx_set): Use arith_operand. (muldi3, muldi3_sp64, muldi3_v8plus): Likewise. (smulsi3_highpart_v8plus, const_smulsi3_highpart_v8plus, umulsi3_highpart_v8plus, const_umulsi3_highpart_v8plus): Use small_int_operand predicate. (divdi3, udivdi3): Use arith_operand predicate. (udivsi3, udivsi3_sp32, udivsi3_sp64): Use nonimmediate_operand. (and<V64I>3_sp64, ior<V64I>3_sp64, xor<V64I:mode>3_sp64, xor_not_<V64I:mode>_sp64) : Use arith_operand predicate. (xordi3_sp64_dbl): Delete. (cmp_ccx_arith_op, cmp_ccx_arith_op_set, cmp_ccx_xor_not, cmp_ccx_xor_not_set, cmp_ccx_arith_op_not, cmp_ccx_arith_op_not_set, cmp_ccx_neg, cmp_ccx_set_neg, one_cmpl<V64I>2_sp64, cmp_ccx_not, cmp_ccx_set_not): Use arith_operand predicate. (ashrsi3_extend2, lshrsi3_extend2 et al.): Use small_int_operand. * config/sparc/predicates.md: New file. From-SVN: r98494
2005-04-21 08:37:52 +02:00
/* 10- and 11-bit immediates are only used for a few specific insns.
SMALL_INT is used throughout the port so we continue to use it. */
#define SMALL_INT(X) (SPARC_SIMM13_P (INTVAL (X)))
sparc.c (reg_or_0_operand, [...]): Delete. * config/sparc/sparc.c (reg_or_0_operand, const1_operand, fp_zero_operand, fp_register_operand, intreg_operand, fcc_reg_operand, fcc0_reg_operand, icc_or_fcc_reg_operand, call_operand, call_operand_address, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand, symbolic_operand, symbolic_memory_operand, label_ref_operand, sp64_medium_pic_operand, data_segment_operand, text_segment_operand, splittable_symbolic_memory_operand, reg_or_nonsymb_mem_operand, splittable_immediate_memory_operand, eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, extend_op, cc_arithop, cc_arithopn, arith_operand, arith_4096_operand, arith_add_operand, const64_operand, const64_high_operand, arith11_operand, arith10_operand, arith_double_operand, arith_double_4096_operand, arith_double_add_operand, arith11_double_operand, arith10_double_operand, small_int, small_int_or_double, uns_small_int, uns_arith_operand, clobbered_register, input_operand, compare_operand): Delete. (sparc_emit_set_const32): Use predicates in assertion. Remove special code for TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT != 64. (sparc_emit_set_const64): Call gcc_unreachable if H_B_P_W_I == 32. (GEN_HIGHINT64, GEN_INT64): Delete. (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, gen_safe_XOR64): Adjust for above deletion. (sparc_emit_set_const64): Support only H_B_P_W_I == 64 and CONST_INTs. Use 'unsigned HOST_WIDE_INT' instead of 'long' for bitmask. (legitimate_constant_p): Use const_zero_operand instead. (sparc_extra_constraint_check): Likewise. * config/sparc/sparc.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'O'. (PREFERRED_RELOAD_CLASS): Use const_zero_operand. (PREDICATE_CODES): Delete. * config/sparc/sparc.md: Include predicates.md. (All patterns): Adjust for new predicate names. (cmpdi, cmpdi_sp64): Use arith_operand predicate. (movhi_const64_special, movsi_const64_special): Add 'K' constraint. (movdi): Use general_operand predicate. (movdi_sp64_dbl): Delete. (movdi_const64_special): Add 'N' constraint. (movdicc): Use arith10_operand predicate. (movdi_cc_sp64, movdi_cc_sp64_trunc): Use arith11_operand predicate. (movdi_cc_reg_sp64): Use arith10_operand predicate. (movdi_cc_reg_sp64_trunc): Delete. (cmp_zero_extract, cmp_zero_extract_sp64): Use small_int_operand. (adddi3_insn_sp32, addx, cmp_cc_plus, cmp_ccx_plus, cmp_cc_plus_set, cmp_ccx_plus_set): Use register_operand predicate. (adddi3_sp64, cmp_ccx_plus_set): Use arith_operand predicate. (subdi3_sp32): Delete. (subdi3_insn_sp32): Change to define_insn_and_split. (subdi3_sp64, cmp_minus_ccx, cmp_minus_ccx_set): Use arith_operand. (muldi3, muldi3_sp64, muldi3_v8plus): Likewise. (smulsi3_highpart_v8plus, const_smulsi3_highpart_v8plus, umulsi3_highpart_v8plus, const_umulsi3_highpart_v8plus): Use small_int_operand predicate. (divdi3, udivdi3): Use arith_operand predicate. (udivsi3, udivsi3_sp32, udivsi3_sp64): Use nonimmediate_operand. (and<V64I>3_sp64, ior<V64I>3_sp64, xor<V64I:mode>3_sp64, xor_not_<V64I:mode>_sp64) : Use arith_operand predicate. (xordi3_sp64_dbl): Delete. (cmp_ccx_arith_op, cmp_ccx_arith_op_set, cmp_ccx_xor_not, cmp_ccx_xor_not_set, cmp_ccx_arith_op_not, cmp_ccx_arith_op_not_set, cmp_ccx_neg, cmp_ccx_set_neg, one_cmpl<V64I>2_sp64, cmp_ccx_not, cmp_ccx_set_not): Use arith_operand predicate. (ashrsi3_extend2, lshrsi3_extend2 et al.): Use small_int_operand. * config/sparc/predicates.md: New file. From-SVN: r98494
2005-04-21 08:37:52 +02:00
/* Predicate for constants that can be loaded with a sethi instruction.
This is the general, 64-bit aware, bitwise version that ensures that
only constants whose representation fits in the mask
0x00000000fffffc00
are accepted. It will reject, for example, negative SImode constants
on 64-bit hosts, so correct handling is to mask the value beforehand
according to the mode of the instruction. */
#define SPARC_SETHI_P(X) \
(((unsigned HOST_WIDE_INT) (X) \
& ((unsigned HOST_WIDE_INT) 0x3ff - GET_MODE_MASK (SImode) - 1)) == 0)
sparc.c (reg_or_0_operand, [...]): Delete. * config/sparc/sparc.c (reg_or_0_operand, const1_operand, fp_zero_operand, fp_register_operand, intreg_operand, fcc_reg_operand, fcc0_reg_operand, icc_or_fcc_reg_operand, call_operand, call_operand_address, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand, symbolic_operand, symbolic_memory_operand, label_ref_operand, sp64_medium_pic_operand, data_segment_operand, text_segment_operand, splittable_symbolic_memory_operand, reg_or_nonsymb_mem_operand, splittable_immediate_memory_operand, eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, extend_op, cc_arithop, cc_arithopn, arith_operand, arith_4096_operand, arith_add_operand, const64_operand, const64_high_operand, arith11_operand, arith10_operand, arith_double_operand, arith_double_4096_operand, arith_double_add_operand, arith11_double_operand, arith10_double_operand, small_int, small_int_or_double, uns_small_int, uns_arith_operand, clobbered_register, input_operand, compare_operand): Delete. (sparc_emit_set_const32): Use predicates in assertion. Remove special code for TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT != 64. (sparc_emit_set_const64): Call gcc_unreachable if H_B_P_W_I == 32. (GEN_HIGHINT64, GEN_INT64): Delete. (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, gen_safe_XOR64): Adjust for above deletion. (sparc_emit_set_const64): Support only H_B_P_W_I == 64 and CONST_INTs. Use 'unsigned HOST_WIDE_INT' instead of 'long' for bitmask. (legitimate_constant_p): Use const_zero_operand instead. (sparc_extra_constraint_check): Likewise. * config/sparc/sparc.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'O'. (PREFERRED_RELOAD_CLASS): Use const_zero_operand. (PREDICATE_CODES): Delete. * config/sparc/sparc.md: Include predicates.md. (All patterns): Adjust for new predicate names. (cmpdi, cmpdi_sp64): Use arith_operand predicate. (movhi_const64_special, movsi_const64_special): Add 'K' constraint. (movdi): Use general_operand predicate. (movdi_sp64_dbl): Delete. (movdi_const64_special): Add 'N' constraint. (movdicc): Use arith10_operand predicate. (movdi_cc_sp64, movdi_cc_sp64_trunc): Use arith11_operand predicate. (movdi_cc_reg_sp64): Use arith10_operand predicate. (movdi_cc_reg_sp64_trunc): Delete. (cmp_zero_extract, cmp_zero_extract_sp64): Use small_int_operand. (adddi3_insn_sp32, addx, cmp_cc_plus, cmp_ccx_plus, cmp_cc_plus_set, cmp_ccx_plus_set): Use register_operand predicate. (adddi3_sp64, cmp_ccx_plus_set): Use arith_operand predicate. (subdi3_sp32): Delete. (subdi3_insn_sp32): Change to define_insn_and_split. (subdi3_sp64, cmp_minus_ccx, cmp_minus_ccx_set): Use arith_operand. (muldi3, muldi3_sp64, muldi3_v8plus): Likewise. (smulsi3_highpart_v8plus, const_smulsi3_highpart_v8plus, umulsi3_highpart_v8plus, const_umulsi3_highpart_v8plus): Use small_int_operand predicate. (divdi3, udivdi3): Use arith_operand predicate. (udivsi3, udivsi3_sp32, udivsi3_sp64): Use nonimmediate_operand. (and<V64I>3_sp64, ior<V64I>3_sp64, xor<V64I:mode>3_sp64, xor_not_<V64I:mode>_sp64) : Use arith_operand predicate. (xordi3_sp64_dbl): Delete. (cmp_ccx_arith_op, cmp_ccx_arith_op_set, cmp_ccx_xor_not, cmp_ccx_xor_not_set, cmp_ccx_arith_op_not, cmp_ccx_arith_op_not_set, cmp_ccx_neg, cmp_ccx_set_neg, one_cmpl<V64I>2_sp64, cmp_ccx_not, cmp_ccx_set_not): Use arith_operand predicate. (ashrsi3_extend2, lshrsi3_extend2 et al.): Use small_int_operand. * config/sparc/predicates.md: New file. From-SVN: r98494
2005-04-21 08:37:52 +02:00
/* Version of the above predicate for SImode constants and below. */
#define SPARC_SETHI32_P(X) \
(SPARC_SETHI_P ((unsigned HOST_WIDE_INT) (X) & GET_MODE_MASK (SImode)))
1992-01-30 21:58:19 +01:00
Add support for sparc VIS3 fp<-->int moves. * config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED): We can move between float and non-float regs when VIS3. * config/sparc/sparc.c (eligible_for_restore_insn): We can't use a restore when the source is a float register. (sparc_split_regreg_legitimate): When VIS3 allow moves between float and integer regs. (sparc_register_move_cost): Adjust to account for VIS3 moves. (sparc_preferred_reload_class): On 32-bit with VIS3 when moving an integer reg to a class containing EXTRA_FP_REGS, constrain to FP_REGS. (sparc_secondary_reload): On 32-bit with VIS3 when moving between float and integer regs we sometimes need a FP_REGS class intermediate move to satisfy the reload. When this happens specify an extra cost of 2. (*movsi_insn): Rename to have "_novis3" suffix and add !VIS3 guard. (*movdi_insn_sp32_v9): Likewise. (*movdi_insn_sp64): Likewise. (*movsf_insn): Likewise. (*movdf_insn_sp32_v9): Likewise. (*movdf_insn_sp64): Likewise. (*zero_extendsidi2_insn_sp64): Likewise. (*sign_extendsidi2_insn): Likewise. (*movsi_insn_vis3): New insn. (*movdi_insn_sp32_v9_vis3): New insn. (*movdi_insn_sp64_vis3): New insn. (*movsf_insn_vis3): New insn. (*movdf_insn_sp32_v9_vis3): New insn. (*movdf_insn_sp64_vis3): New insn. (*zero_extendsidi2_insn_sp64_vis3): New insn. (*sign_extendsidi2_insn_vis3): New insn. (TFmode reg/reg split): Make sure both REG operands are float. (*mov<VM32:mode>_insn): Add "_novis3" suffix and !VIS3 guard. Remove easy constant to integer reg alternatives. (*mov<VM64:mode>_insn_sp64): Likewise. (*mov<VM64:mode>_insn_sp32_novis3): Likewise. (*mov<VM32:mode>_insn_vis3): New insn. (*mov<VM64:mode>_insn_sp64_vis3): New insn. (*mov<VM64:mode>_insn_sp32_vis3): New insn. (VM64 reg<-->reg split): New spliiter for 32-bit. From-SVN: r180360
2011-10-24 05:51:47 +02:00
/* On SPARC when not VIS3 it is not possible to directly move data
between GENERAL_REGS and FP_REGS. */
#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
Add support for sparc VIS3 fp<-->int moves. * config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED): We can move between float and non-float regs when VIS3. * config/sparc/sparc.c (eligible_for_restore_insn): We can't use a restore when the source is a float register. (sparc_split_regreg_legitimate): When VIS3 allow moves between float and integer regs. (sparc_register_move_cost): Adjust to account for VIS3 moves. (sparc_preferred_reload_class): On 32-bit with VIS3 when moving an integer reg to a class containing EXTRA_FP_REGS, constrain to FP_REGS. (sparc_secondary_reload): On 32-bit with VIS3 when moving between float and integer regs we sometimes need a FP_REGS class intermediate move to satisfy the reload. When this happens specify an extra cost of 2. (*movsi_insn): Rename to have "_novis3" suffix and add !VIS3 guard. (*movdi_insn_sp32_v9): Likewise. (*movdi_insn_sp64): Likewise. (*movsf_insn): Likewise. (*movdf_insn_sp32_v9): Likewise. (*movdf_insn_sp64): Likewise. (*zero_extendsidi2_insn_sp64): Likewise. (*sign_extendsidi2_insn): Likewise. (*movsi_insn_vis3): New insn. (*movdi_insn_sp32_v9_vis3): New insn. (*movdi_insn_sp64_vis3): New insn. (*movsf_insn_vis3): New insn. (*movdf_insn_sp32_v9_vis3): New insn. (*movdf_insn_sp64_vis3): New insn. (*zero_extendsidi2_insn_sp64_vis3): New insn. (*sign_extendsidi2_insn_vis3): New insn. (TFmode reg/reg split): Make sure both REG operands are float. (*mov<VM32:mode>_insn): Add "_novis3" suffix and !VIS3 guard. Remove easy constant to integer reg alternatives. (*mov<VM64:mode>_insn_sp64): Likewise. (*mov<VM64:mode>_insn_sp32_novis3): Likewise. (*mov<VM32:mode>_insn_vis3): New insn. (*mov<VM64:mode>_insn_sp64_vis3): New insn. (*mov<VM64:mode>_insn_sp32_vis3): New insn. (VM64 reg<-->reg split): New spliiter for 32-bit. From-SVN: r180360
2011-10-24 05:51:47 +02:00
((FP_REG_CLASS_P (CLASS1) != FP_REG_CLASS_P (CLASS2)) \
&& (! TARGET_VIS3 \
|| GET_MODE_SIZE (MODE) > 8 \
|| GET_MODE_SIZE (MODE) < 4))
/* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on v9
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
because the movsi and movsf patterns don't handle r/f moves.
For v8 we copy the default definition. */
#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
(TARGET_ARCH64 \
? (GET_MODE_BITSIZE (MODE) < 32 \
? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
: MODE) \
: (GET_MODE_BITSIZE (MODE) < BITS_PER_WORD \
? mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0) \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
: MODE))
1992-01-30 21:58:19 +01:00
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
/* On SPARC, this is the size of MODE in words. */
#define CLASS_MAX_NREGS(CLASS, MODE) \
(FP_REG_CLASS_P (CLASS) ? (GET_MODE_SIZE (MODE) + 3) / 4 \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
: (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
1992-01-30 21:58:19 +01:00
/* Stack layout; function entry, exit and calling. */
/* Define this if pushing a word on the stack
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
/* Define this to nonzero if the nominal address of the stack frame
1992-01-30 21:58:19 +01:00
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined. * defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined. * function.c (get_func_frame_size): Use if (FRAME_GROWS_DOWNWARD) instead of preprocessor conditionals. (assign_stack_local_1, assign_stack_temp_for_type): Likewise. * cfgexpand.c (FRAME_GROWS_DOWNWARD): Don't redefine to 1 or 0 depending on if it was or was not defined previously. * doc/rtl.texi (VIRTUAL_STACK_VARS_REGNUM): Mention that only non-zero definition of FRAME_GROWS_DOWNWARD means frame grows downward. * doc/tm.texi (FRAME_GROWS_DOWNWARD): Likewise. * config/m68hc11/m68hc11.h (FRAME_GROWS_DOWNWARD): Define to 0. Update comment. * config/pa/pa.h (FRAME_GROWS_DOWNWARD): Likewise. * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Likewise. * config/stormy16/stormy16.h (FRAME_GROWS_DOWNWARD): Define to 0. * config/c4x/c4x.h (FRAME_GROWS_DOWNWARD): Likewise. * config/sh/sh.h (FRAME_GROWS_DOWNWARD): Likewise. * config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Likewise. * config/iq2000/iq2000.h (FRAME_GROWS_DOWNWARD): Likewise. * config/pdp11/pdp11.h (FRAME_GROWS_DOWNWARD): Define to 1. Update comment. * config/i860/i860.h (FRAME_GROWS_DOWNWARD): Likewise. * config/h8300/h8300.h (FRAME_GROWS_DOWNWARD): Likewise. * config/arc/arc.h (FRAME_GROWS_DOWNWARD): Likewise. * config/vax/vax.h (FRAME_GROWS_DOWNWARD): Likewise. * config/sparc/sparc.h (FRAME_GROWS_DOWNWARD): Likewise. * config/i386/i386.h (FRAME_GROWS_DOWNWARD): Likewise. * config/fr30/fr30.h (FRAME_GROWS_DOWNWARD): Likewise. * config/frv/frv.h (FRAME_GROWS_DOWNWARD): Likewise. * config/mn10300/mn10300.h (FRAME_GROWS_DOWNWARD): Likewise. * config/bfin/bfin.h (FRAME_GROWS_DOWNWARD): Likewise. * config/ns32k/ns32k.h (FRAME_GROWS_DOWNWARD): Likewise. * config/v850/v850.h (FRAME_GROWS_DOWNWARD): Likewise. * config/alpha/alpha.h (FRAME_GROWS_DOWNWARD): Update comment. * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Likewise. * config/arm/arm.h (FRAME_GROWS_DOWNWARD): Likewise. * config/alpha/unicosmk.h (FRAME_GROWS_DOWNWARD): Define to 1. * config/cris/cris.h (FRAME_GROWS_DOWNWARD): Likewise. * config/m68k/m68k.h (FRAME_GROWS_DOWNWARD): Likewise. * config/mmix/mmix.h (FRAME_GROWS_DOWNWARD): Likewise. From-SVN: r101329
2005-06-26 07:18:53 +02:00
#define FRAME_GROWS_DOWNWARD 1
1992-01-30 21:58:19 +01:00
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
first local allocated. Otherwise, it is the offset to the BEGINNING
of the first local allocated. */
#define STARTING_FRAME_OFFSET 0
1992-01-30 21:58:19 +01:00
/* Offset of first parameter from the argument pointer register value.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
!v9: This is 64 for the ins and locals, plus 4 for the struct-return reg
even if this function isn't going to use it.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
v9: This is 128 for the ins and locals. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define FIRST_PARM_OFFSET(FNDECL) \
(TARGET_ARCH64 ? 16 * UNITS_PER_WORD : STRUCT_VALUE_OFFSET + UNITS_PER_WORD)
1992-01-30 21:58:19 +01:00
/* Offset from the argument pointer register value to the CFA.
This is different from FIRST_PARM_OFFSET because the register window
comes between the CFA and the arguments. */
#define ARG_POINTER_CFA_OFFSET(FNDECL) 0
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. * c-decl.c (init_decl_processing): Update accordingly. * expr.c (expand_builtin): Likewise. * cp/decl.c (init_decl_processing): Likewise. * rtl.h (global_rtl): Add cfa entry. (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. (LAST_VIRTUAL_REGISTER): Update. * emit-rtl.c (global_rtl): Add cfa entry. (init_emit): Initialize it. * function.c (cfa_offset): New. (instantiate_virtual_regs): Initialize it. (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. (expand_function_end): Call expand_eh_return. * tm.texi (ARG_POINTER_CFA_OFFSET): New. * except.c (current_function_eh_stub_label): Kill. (current_function_eh_old_stub_label): Likwise; update all references. (expand_builtin_set_return_addr_reg): Kill. (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. (expand_builtin_set_eh_regs): Kill. (eh_regs): Produce a third reg for the actual handler address. (eh_return_context, eh_return_stack_adjust): New. (eh_return_handler, eh_return_stub_label): New. (init_eh_for_function): Initialize them. (expand_builtin_eh_return, expand_eh_return): New. * except.h: Update prototypes. * flow.c (find_basic_blocks_1): Update references to the stub label. * function.h (struct function): Kill stub label elements. * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the register number is one that would be in the previous window. Provide a dummy definition for non-windowed targets. (get_reg_addr): New function. (get_reg, put_reg, copy_reg): Use it. (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. * alpha.c (alpha_eh_epilogue_sp_ofs): New. (alpha_init_expanders): Initialize it. (alpha_expand_epilogue): Use it. * alpha.h: Declare it. * alpha.md (eh_epilogue): New. * m68h.h (ARG_POINTER_CFA_OFFSET): New. * sparc.h (ARG_POINTER_CFA_OFFSET): New. From-SVN: r22436
1998-09-15 21:19:12 +02:00
1992-01-30 21:58:19 +01:00
/* When a parameter is passed in a register, stack space is still
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
allocated for it.
!v9: All 6 possible integer registers have backing store allocated.
v9: Only space for the arguments passed is allocated. */
Support for official Sparc V9 ABI: * sparc.c (sparc_override_options): Force stack bias off for !arch64. Care for flag_pcc_struct_return default. (output_move_quad): Rewrite to move by halves on v9 and in the proper direction. (move_quad_direction): New function. (output_fp_move_quad): Use it to determine the direction of copy. (function_arg_slotno): Return -1 for FP reg overflow as well. (function_arg_record_value*): New functions. (function_arg): Use them. Streamline unprototyped parameter passing. (function_arg_pass_by_reference): Pass TCmode by reference. (function_value): New function. * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use long long in 64-bit mode. (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (FUNCTION_VALUE): Call function_value. (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. * sparc.md (movdi_sp32_v9): Disable for arch64. (movsf, movdf, movtf): Sort all ulternatives using fp regs first. (call_value_address_sp64): Remove register class constraints. (call_value_symbolic_sp64): Likewise. (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain v9 case to 32-bit constants. (goto_handler_and_restore_v9): Provide a version for arch64. * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. (CPP_PREDEFINES): New. * sparc/sp64-elf.h: Likewise. (PREFERRED_DEBUGGING_TYPE): Dwarf2. (ASM_OUTPUT_DWARF2_ADDR_CONST): New. * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. From-SVN: r19526
1998-05-03 16:19:46 +02:00
/* ??? Ideally, we'd use zero here (as the minimum), but zero has special
meaning to the backend. Further, we need to be able to detect if a
varargs/unprototyped function is called, as they may want to spill more
registers than we've provided space. Ugly, ugly. So for now we retain
all 6 slots even for v9. */
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
#define REG_PARM_STACK_SPACE(DECL) (6 * UNITS_PER_WORD)
1992-01-30 21:58:19 +01:00
/* Definitions for register elimination. */
#define ELIMINABLE_REGS \
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM} }
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do \
{ \
(OFFSET) = sparc_initial_elimination_offset ((TO)); \
} \
while (0)
1992-01-30 21:58:19 +01:00
/* Keep the stack pointer constant throughout the function.
This is both an optimization and a necessity: longjmp
1992-01-30 21:58:19 +01:00
doesn't behave itself when the stack pointer moves within
the function! */
Convert ACCUMULATE_OUTGOING_ARGS to an expression. * calls.c (PUSH_ARGS_REVERSED) Change to expression. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (struct arg_data): Remove #ifdef ACCUMULATE_OUTGOING_ARGS. (save_fixed_argument_area, restore_fixed_argument_area): conditionize by #ifdef REG_PARM_STACK_SPACE only. (emit_call): Change #ifdefs on ACCUMULATE_OUTGOING_ARGS to conditions, handle RETURN_POPS_ARGS on ACCUMULATE_OUTGOING_ARGS. (precompute_register_parameters): Avoid #ifdefs on ACCUMULATE_OUTGOING_ARGS and PUSH_ARGS_REVERSED. (stire_one_args): Likewise. (expand_call): Likewise; conditionize PUSH_ROUNDING code by PUSH_ARGS. (emit_library_call_value_1): Likewise. (compute_argument_block_size): Align to STACK_BOUNDARY only for ACCUMULATE_OUTGOING_ARGS. * combine.c (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (nonzero_bits): Conditionize PUSH_ROUNDING code by USE_PUSH. (use_crosses_set_p): Likewise. * all targets (ACCUMULATE_OUTGOING_ARGS define): Change to #define ACCUMULATE_OUTGOING_ARGS 1. * i386.c (ix86_compute_frame_size): Handle ACCUMULATE_OUTGOING_ARGS frames. * i386.h (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS): New constants. (TARGET_PUSH_ARGS, TARGET_ACCUMULATE_OUTGOING_ARGS): New macros. (TARGET_SWITCHES): Add push-args, no-push-args, accumulate-outgoing-args and no-accumulate-outgoing-args. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): New macro. * expr.c (ACCUMULATE_OUTGONG_ARGS, PUSH_ARGS): Provide default. (push_block): Avoid ifdefs on ACCUMULATE_OUTGONG_ARGS and PUSH_ROUNDING. (emit_push_insn): Likewise. * final.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (final_scan_insn): Avoid ifdefs on ACCUMULATE_OUTGOING_ARGS. * function.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (STACK_DYNAMIC_OFFSET): Define correctly for both ACCUMULATE_OUTGOING_ARGS and normal mode. * invoke.texi (-mpush_args, -maccumulate-outgoing-args): Document. * tm.texi (PUSH_ARGS): Document. (ACCUMULATE_OUTGOING_ARGS, PUSH_ROUNDING): Update documentation. From-SVN: r32803
2000-03-29 15:10:44 +02:00
#define ACCUMULATE_OUTGOING_ARGS 1
1992-01-30 21:58:19 +01:00
/* Define this macro if the target machine has "register windows". This
C expression returns the register number as seen by the called function
corresponding to register number OUT as seen by the calling function.
Return OUT if register number OUT is not an outbound register. */
#define INCOMING_REGNO(OUT) \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
((TARGET_FLAT || (OUT) < 8 || (OUT) > 15) ? (OUT) : (OUT) + 16)
/* Define this macro if the target machine has "register windows". This
C expression returns the register number as seen by the calling function
corresponding to register number IN as seen by the called function.
Return IN if register number IN is not an inbound register. */
#define OUTGOING_REGNO(IN) \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
((TARGET_FLAT || (IN) < 24 || (IN) > 31) ? (IN) : (IN) - 16)
/* Define this macro if the target machine has register windows. This
C expression returns true if the register is call-saved but is in the
register window. */
#define LOCAL_REGNO(REGNO) \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
(!TARGET_FLAT && (REGNO) >= 16 && (REGNO) <= 31)
/* Define the size of space to allocate for the return value of an
untyped_call. */
#define APPLY_RESULT_SIZE (TARGET_ARCH64 ? 24 : 16)
1992-01-30 21:58:19 +01:00
/* 1 if N is a possible register number for function argument passing.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
On SPARC, these are the "output" registers. v9 also uses %f0-%f31. */
1992-01-30 21:58:19 +01:00
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define FUNCTION_ARG_REGNO_P(N) \
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
(TARGET_ARCH64 \
? (((N) >= 8 && (N) <= 13) || ((N) >= 32 && (N) <= 63)) \
: ((N) >= 8 && (N) <= 13))
1992-01-30 21:58:19 +01:00
/* Define a data type for recording info about an argument list
during the scan of that argument list. This data type should
hold all necessary information about the function itself
and about the args processed so far, enough to enable macros
such as FUNCTION_ARG to determine where the next arg should go.
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
On SPARC (!v9), this is a single integer, which is a number of words
1992-01-30 21:58:19 +01:00
of arguments scanned so far (including the invisible argument,
if any, which holds the structure-value-address).
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
Thus 7 or more means all following args should go on the stack.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
For v9, we also need to know whether a prototype is present. */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
struct sparc_args {
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
int words; /* number of words passed so far */
int prototype_p; /* nonzero if a prototype is present */
int libcall_p; /* nonzero if a library call */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
};
#define CUMULATIVE_ARGS struct sparc_args
1992-01-30 21:58:19 +01:00
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
For a library call, FNTYPE is 0. */
1992-01-30 21:58:19 +01:00
tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. (emit_library_call_value_1): Likewise pass nargs. * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args parameter instead of scanning TYPE_ARGS_TYPES to count args. * config/rs6000/rs6000-protos.h (init_cumulative_args): Update prototype. * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to INIT_CUMULATIVE_ARGS. * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h, config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h, config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise. From-SVN: r77380
2004-02-06 07:18:36 +01:00
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
init_cumulative_args (& (CUM), (FNTYPE), (LIBNAME), (FNDECL));
1992-01-30 21:58:19 +01:00
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
/* If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
`enum direction': either `upward' to pad above the argument,
`downward' to pad below, or `none' to inhibit padding. */
sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. (SPARC_FP_ARG_FIRST): New macro. (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. (NPARM_REGS): There are 32 fp argument registers now. (FUNCTION_ARG_REGNO_P): Likewise. (FIRST_PARM_OFFSET): Update to new v9 abi. (REG_PARM_STACK_SPACE): Define for arch64. (enum sparc_arg_class): Delete. (sparc_arg_count,sparc_n_named_args): Delete. (struct sparc_args): Redefine and use for arch32 as well as arch64. (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. (FUNCTION_ARG_ADVANCE): Rewrite. (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. (FUNCTION_ARG_CALLEE_COPIES): Delete. (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. (STRICT_ARGUMENT_NAMING): Define. (doublemove_string): Declare. * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. (single_move_string): Use GEN_INT, and HOST_WIDE_INT. (doublemove_string): New function. (output_move_quad): Clean up some of the arch64 support. (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. Don't add 8 bytes of reserved space if arch64. (sparc_builtin_saveregs): Combine arch32/arch64 versions. (init_cumulative_args): New function. (function_arg_slotno): New static function. (function_arg,function_arg_partial_nregs): New functions. (function_arg_{pass_by_reference,advance}): New functions. (function_arg_padding): New function. First pass at updating to current v9 abi. From-SVN: r15968
1997-10-17 22:39:37 +02:00
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
function_arg_padding ((MODE), (TYPE))
1992-01-30 21:58:19 +01:00
/* Generate the special assembly code needed to tell the assembler whatever
it might need to know about the return value of a function.
For SPARC assemblers, we need to output a .proc pseudo-op which conveys
information to the assembler relating to peephole optimization (done in
the assembler). */
#define ASM_DECLARE_RESULT(FILE, RESULT) \
fprintf ((FILE), "\t.proc\t0%lo\n", sparc_type_code (TREE_TYPE (RESULT)))
/* Output the special assembly code needed to tell the assembler some
register is used as global register variable.
SPARC 64bit psABI declares registers %g2 and %g3 as application
registers and %g6 and %g7 as OS registers. Any object using them
should declare (for %g2/%g3 has to, for %g6/%g7 can) that it uses them
and how they are used (scratch or some global variable).
Linker will then refuse to link together objects which use those
registers incompatibly.
Unless the registers are used for scratch, two different global
registers cannot be declared to the same name, so in the unlikely
case of a global register variable occupying more than one register
we prefix the second and following registers with .gnu.part1. etc. */
extern GTY(()) char sparc_hard_reg_printed[8];
#ifdef HAVE_AS_REGISTER_PSEUDO_OP
#define ASM_DECLARE_REGISTER_GLOBAL(FILE, DECL, REGNO, NAME) \
do { \
if (TARGET_ARCH64) \
{ \
int end = HARD_REGNO_NREGS ((REGNO), DECL_MODE (decl)) + (REGNO); \
int reg; \
for (reg = (REGNO); reg < 8 && reg < end; reg++) \
if ((reg & ~1) == 2 || (reg & ~1) == 6) \
{ \
if (reg == (REGNO)) \
fprintf ((FILE), "\t.register\t%%g%d, %s\n", reg, (NAME)); \
else \
fprintf ((FILE), "\t.register\t%%g%d, .gnu.part%d.%s\n", \
reg, reg - (REGNO), (NAME)); \
sparc_hard_reg_printed[reg] = 1; \
} \
} \
} while (0)
#endif
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
/* Emit rtl for profiling. */
#define PROFILE_HOOK(LABEL) sparc_profile_hook (LABEL)
/* All the work done in PROFILE_HOOK, but still required. */
#define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
1992-01-30 21:58:19 +01:00
/* Set the name of the mcount function for the system. */
#define MCOUNT_FUNCTION "*mcount"
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
1992-01-30 21:58:19 +01:00
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
functions that have frame pointers. */
#define EXIT_IGNORE_STACK 1
1992-01-30 21:58:19 +01:00
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE (TARGET_ARCH64 ? 32 : 16)
2011-06-02 12:48:11 +02:00
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT 128
/* Generate RTL to flush the register windows so as to make arbitrary frames
available. */
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define SETUP_FRAME_ADDRESSES() \
do { \
if (!TARGET_FLAT) \
emit_insn (gen_flush_register_windows ());\
} while (0)
/* Given an rtx for the address of a frame,
return an rtx for the address of the word in the frame
invoke.texi (SPARC options): Remove -mflat and all -mxxx (xxx:chip) options. * doc/invoke.texi (SPARC options): Remove -mflat and all -mxxx (xxx:chip) options. * config/sparc/aout.h (DBX_REGISTER_NUMBER): Delete. * config/sparc/litecoff.h (DBX_REGISTER_NUMBER): Likewise. * config/sparc/netbsd-elf.h (DBX_REGISTER_NUMBER): Likewise. * config/sparc/sol2.h (DBX_REGISTER_NUMBER): Likewise. * config/sparc/sparc-protos.h: Delete sparc_flat_* prototypes. * config/sparc/sparc.c: Likewise. (sparc_output_function_prologue): Remove TARGET_FLAT handling. (sparc_nonflat_function_prologue): Rename into sparc_function_prologue. (sparc_output_function_epilogue): Remove TARGET_FLAT handling. (sparc_nonflat_function_epilogue): Rename into sparc_function_epilogue. (struct sparc_frame_info, current_frame_info, zero_frame_info): Delete. (sparc_flat_must_save_register_p): Likewise. (sparc_flat_compute_frame_size): Likewise. (sparc_flat_save_restore): Likewise. (sparc_flat_function_prologue): Likewise. (sparc_flat_function_epilogue): Likewise. (sparc_flat_epilogue_delay_slots): Likewise. (sparc_flat_eligible_for_epilogue_delay): Likewise. (sparc_function_ok_for_sibcall): Remove TARGET_FLAT handling. * config/sparc/sparc.h (MASK_FLAT, TARGET_FLAT): Delete. (TARGET_SWITCHES): Remove -mflat and all -mxxx (xxx:chip) options. (SPARC_INCOMING_INT_ARG_FIRST): Remove TARGET_FLAT handling. (CONDITIONAL_REGISTER_USAGE): Likewise. (FRAME_POINTER_REQUIRED): Likewise. (INITIAL_ELIMINATION_OFFSET): Likewise. (BASE_RETURN_VALUE_REG): Likewise. (BASE_OUTGOING_VALUE_REG): Likewise. (BASE_PASSING_ARG_REG): Likewise. (BASE_INCOMING_ARG_REG): Likewise. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (DELAY_SLOTS_FOR_EPILOGUE): Likewise. (ELIGIBLE_FOR_EPILOGUE_DELAY): Likewise. (EPILOGUE_USES): Likewise. * config/sparc/sparc.md ("isa" attribute): Change "v6" into "v7". ("flat" attribute): Delete. (do_builtin_setjmp_setup): Remove TARGET_FLAT and "flat" attribute handling. (call followed by jump define_peephole's): Delete. (exception_receiver): Likewise. (builtin_setjmp_receiver): Likewise. * config/sparc/t-sparclite (MULTILIB_OPTIONS): Remove -mflat. From-SVN: r77169
2004-02-03 13:36:23 +01:00
that holds the dynamic chain--the previous frame's address. */
#define DYNAMIC_CHAIN_ADDRESS(frame) \
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
plus_constant (Pmode, frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
/* Given an rtx for the frame pointer,
return an rtx for the address of the frame. */
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
#define FRAME_ADDR_RTX(frame) plus_constant (Pmode, frame, SPARC_STACK_BIAS)
/* The return address isn't on the stack, it is in a register, so we can't
access it from the current frame pointer. We can access it from the
previous frame pointer though by reading a value from the register window
save area. */
#define RETURN_ADDR_IN_PREVIOUS_FRAME
/* This is the offset of the return address to the true next instruction to be
executed for the current function. */
#define RETURN_ADDR_OFFSET \
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
(8 + 4 * (! TARGET_ARCH64 && cfun->returns_struct))
/* The current return address is in %i7. The return address of anything
farther back is in the register window save area at [%fp+60]. */
/* ??? This ignores the fact that the actual return address is +8 for normal
returns, and +12 for structure returns. */
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define RETURN_ADDR_REGNUM 31
#define RETURN_ADDR_RTX(count, frame) \
((count == -1) \
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
? gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM) \
: gen_rtx_MEM (Pmode, \
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
memory_address (Pmode, plus_constant (Pmode, frame, \
15 * UNITS_PER_WORD \
+ SPARC_STACK_BIAS))))
1996-07-26 20:17:32 +02:00
/* Before the prologue, the return address is %o7 + 8. OK, sometimes it's
+12, but always using +8 is close enough for frame unwind purposes.
Actually, just using %o7 is close enough for unwinding, but %o7+8
is something you can return to. */
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define INCOMING_RETURN_ADDR_REGNUM 15
#define INCOMING_RETURN_ADDR_RTX \
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
plus_constant (word_mode, \
gen_rtx_REG (word_mode, INCOMING_RETURN_ADDR_REGNUM), 8)
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define DWARF_FRAME_RETURN_COLUMN \
DWARF_FRAME_REGNUM (INCOMING_RETURN_ADDR_REGNUM)
/* The offset from the incoming value of %sp to the top of the stack frame
for the current function. On sparc64, we have to account for the stack
bias if present. */
#define INCOMING_FRAME_SP_OFFSET SPARC_STACK_BIAS
/* Describe how we implement __builtin_eh_return. */
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define EH_RETURN_REGNUM 1
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 24 : INVALID_REGNUM)
invoke.texi (SPARC options): Add -mflat. gcc/ * doc/invoke.texi (SPARC options): Add -mflat. * config/sparc/sparc.opt: Likewise. * config/sparc/sparc-protos.h (sparc_expand_epilogue): Add parameter. (sparc_flat_expand_prologue): Declare. (sparc_flat_expand_epilogue): Likewise. * config/sparc/sparc.h (CPP_CPU_SPEC): Do not handle -msoft-float. (CPP_ENDIAN_SPEC): Replace with... (CPP_OTHER_SPEC): ...this. Also handle -mflat and -msoft-float. (CPP_SPEC): Adjust to above change. (EXTRA_SPECS): Likewise. (SPARC_INCOMING_INT_ARG_FIRST): Add TARGET_FLAT handling. (INCOMING_REGNO): Likewise. (OUTGOING_REGNO): Likewise. (LOCAL_REGNO): Likewise. (SETUP_FRAME_ADDRESSES): Likewise. (FIXED_REGISTERS): Set 0 for %fp. (CALL_USED_REGISTERS): Likewise. (INITIAL_ELIMINATION_OFFSET): Pass current_function_is_leaf. (EXIT_IGNORE_STACK): Define to 1 unconditionally. (RETURN_ADDR_REGNUM): Define. (RETURN_ADDR_RTX): Use it. (INCOMING_RETURN_ADDR_REGNUM): Define. (INCOMING_RETURN_ADDR_RTX): Use it. (DWARF_FRAME_RETURN_COLUMN): Likewise. (EH_RETURN_REGNUM): Define. (EH_RETURN_STACKADJ_RTX): Use it. (EH_RETURN_HANDLER_RTX): Delete. (EPILOGUE_USES): Use them and add TARGET_FLAT handling. * config/sparc/sparc.c (apparent_fsize, actual_fsize, num_gfregs): Delete. (struct machine_function): Add frame_size, apparent_frame_size, frame_base_reg, frame_base_offset, n_global_fp_regs and save_local_in_regs_p fields. (sparc_frame_size, sparc_apparent_frame_size, sparc_frame_base_reg, sparc_frame_base_offset, sparc_n_global_fp_regs, sparc_save_local_in_regs_p): New macros. (sparc_option_override): Error out if -fcall-saved-REG is specified for Out registers. (eligible_for_restore_insn): Fix formatting. (eligible_for_return_delay): Likewise. Add TARGET_FLAT handling. (eligible_for_sibcall_delay): Likewise. (RTX_OK_FOR_OFFSET_P, RTX_OK_FOR_OLO10_P): Add MODE parameter. (sparc_legitimate_address_p): Adjust to above change. (save_global_or_fp_reg_p): New predicate. (return_addr_reg_needed_p): Likewise. (save_local_or_in_reg_p): Likewise. (sparc_compute_frame_size): Use them. Add TARGET_FLAT handling. (SORR_SAVE, SORR_RESTORE): Delete. (sorr_pred_t): New typedef. (sorr_act_t): New enum. (save_or_restore_regs): Rename to... (emit_save_or_restore_regs): ...this. Change type of LOW and HIGH parameters, remove ACTION parameter, add LEAF_FUNCTION_P, SAVE_P, ACTION_TRUE and ACTION_FALSE parameters. Implement more general mechanism. Add CFI information for double-word saves in 32-bit mode. (emit_adjust_base_to_offset): New function extracted from... (emit_save_or_restore_regs): ...this. Rename the rest to... (emit_save_or_restore_regs_global_fp_regs): ...this. (emit_save_or_restore_regs_local_in_regs): New function. (gen_create_flat_frame_[123]): New functions. (sparc_expand_prologue): Use SIZE local variable. Adjust. (sparc_flat_expand_prologue): New function. (sparc_asm_function_prologue): Add TARGET_FLAT handling. (sparc_expand_epilogue): Use SIZE local variable. Adjust. (sparc_flat_expand_epilogue): New function. (sparc_can_use_return_insn_p): Add TARGET_FLAT handling. (output_return): Likewise. (output_sibcall): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. (sparc_conditional_register_usage): If TARGET_FLAT, disable the leaf function optimization. * config/sparc/sparc.md (flat): New attribute. (prologue): Add TARGET_FLAT handling. (save_register_window): Disable if TARGET_FLAT. (create_flat_frame_[123]): New patterns. (epilogue): Add TARGET_FLAT handling. (sibcall_epilogue): Likewise. (eh_return): New expander. (eh_return_internal): New insn and splitter. (return_internal): Add TARGET_FLAT handling. (untyped_return): Remove bogus test and use RETURN_ADDR_REGNUM. (save_stack_nonlocal): Use RETURN_ADDR_REGNUM. (nonlocal_goto): Add TARGET_FLAT handling. * config/sparc/t-elf: Add -mflat multilib. * config/sparc/t-leon: Likewise. libgcc/ * config/sparc/linux-unwind.h (STACK_BIAS): Define. (sparc64_fallback_frame_state): Use it. (sparc64_frob_update_context): Further adjust context. * config/sparc/sol2-unwind.h (sparc64_frob_update_context): Likewise. * config/sparc/sol2-ci.S: Add TARGET_FLAT handling. * config/sparc/sol2-cn.S: Likewise. Co-Authored-By: Laurent Rougé <laurent.rouge@menta.fr> From-SVN: r174897
2011-06-10 12:50:20 +02:00
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, EH_RETURN_REGNUM)
/* Define registers used by the epilogue and return instruction. */
#define EPILOGUE_USES(REGNO) \
((REGNO) == RETURN_ADDR_REGNUM \
|| (TARGET_FLAT \
&& epilogue_completed \
&& (REGNO) == INCOMING_RETURN_ADDR_REGNUM) \
|| (crtl->calls_eh_return && (REGNO) == EH_RETURN_REGNUM))
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
If assembler and linker properly support .uaword %r_disp32(foo),
then use PC relative 32-bit relocations instead of absolute relocs
for shared libraries. On sparc64, use pc relative 32-bit relocs even
for binaries, to save memory.
binutils 2.12 would emit a R_SPARC_DISP32 dynamic relocation if the
symbol %r_disp32() is against was not local, but .hidden. In that
case, we have to use DW_EH_PE_absptr for pic personality. */
#ifdef HAVE_AS_SPARC_UA_PCREL
#ifdef HAVE_AS_SPARC_UA_PCREL_HIDDEN
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(flag_pic \
? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
: ((TARGET_ARCH64 && ! GLOBAL) \
? (DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_absptr))
#else
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(flag_pic \
? (GLOBAL ? DW_EH_PE_absptr : (DW_EH_PE_pcrel | DW_EH_PE_sdata4)) \
: ((TARGET_ARCH64 && ! GLOBAL) \
? (DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_absptr))
#endif
/* Emit a PC-relative relocation. */
#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
do { \
fputs (integer_asm_op (SIZE, FALSE), FILE); \
fprintf (FILE, "%%r_disp%d(", SIZE * 8); \
assemble_name (FILE, LABEL); \
fputc (')', FILE); \
} while (0)
#endif
1992-01-30 21:58:19 +01:00
/* Addressing modes, and classification of registers for them. */
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
They give nonzero only if REGNO is a hard reg of the suitable class
or a pseudo reg currently allocated to a suitable hard reg.
Since they use reg_renumber, they are safe only once reg_renumber
has been allocated, which happens in reginfo.c during register
allocation. */
1992-01-30 21:58:19 +01:00
#define REGNO_OK_FOR_INDEX_P(REGNO) \
(SPARC_INT_REG_P (REGNO) || SPARC_INT_REG_P (reg_renumber[REGNO]) \
|| (REGNO) == FRAME_POINTER_REGNUM \
|| reg_renumber[REGNO] == FRAME_POINTER_REGNUM)
#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
1992-01-30 21:58:19 +01:00
#define REGNO_OK_FOR_FP_P(REGNO) \
(((unsigned) (REGNO) - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)) \
|| ((unsigned) reg_renumber[REGNO] - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)))
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define REGNO_OK_FOR_CCFP_P(REGNO) \
(TARGET_V9 \
&& (((unsigned) (REGNO) - 96 < (unsigned)4) \
|| ((unsigned) reg_renumber[REGNO] - 96 < (unsigned)4)))
1992-01-30 21:58:19 +01:00
/* Maximum number of registers that can appear in a valid memory address. */
#define MAX_REGS_PER_ADDRESS 2
/* Recognize any constant value that is a valid address.
When PIC, we do not accept an address that would require a scratch reg
to load into a register. */
1992-01-30 21:58:19 +01:00
sparc.c (struct machine_function): New type. * config/sparc/sparc.c (struct machine_function): New type. (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. (sparc_override_options): Initialize init_machine_status. (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand): New functions. (symbolic_operand): Disallow tls_symbolic_operand. (symbolic_memory_operand): Likewise. (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p): New functions. (sparc_tls_symbol): New variable. (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address, legitimize_address): New functions. (print_operand): Handle %&. (sparc_init_machine_status, get_some_local_dynamic_name, get_some_local_dynamic_name_1): New functions. (sparc_output_dwarf_dtprel): New function. * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into constant_address_p. (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p. (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p. (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p. (LEGITIMIZE_ADDRESS): Moved into legitimize_address. (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define. (ASM_OUTPUT_DWARF_DTPREL): Define. (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand. * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO, UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants. (tls_call_delay): New attribute. (in_call_delay): Use it. (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed. (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64, tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64, tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10, tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32, tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns. (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32, tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64, tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64, tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64, tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64, tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64, tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32, tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New insns. * config/sparc/sparc-protos.h (legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p, legitimize_tls_address, legitimize_address, tls_symbolic_operand, tls_call_delay, sparc_output_dwarf_dtprel): New prototypes. * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define. * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise. * configure.in (sparc*-*-*): Add TLS check. * configure: Rebuilt. From-SVN: r71202
2003-09-08 08:57:05 +02:00
#define CONSTANT_ADDRESS_P(X) constant_address_p (X)
/* Define this, so that when PIC, reload won't try to reload invalid
addresses which require two reload registers. */
sparc.c (struct machine_function): New type. * config/sparc/sparc.c (struct machine_function): New type. (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. (sparc_override_options): Initialize init_machine_status. (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand): New functions. (symbolic_operand): Disallow tls_symbolic_operand. (symbolic_memory_operand): Likewise. (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p): New functions. (sparc_tls_symbol): New variable. (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address, legitimize_address): New functions. (print_operand): Handle %&. (sparc_init_machine_status, get_some_local_dynamic_name, get_some_local_dynamic_name_1): New functions. (sparc_output_dwarf_dtprel): New function. * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into constant_address_p. (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p. (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p. (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p. (LEGITIMIZE_ADDRESS): Moved into legitimize_address. (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define. (ASM_OUTPUT_DWARF_DTPREL): Define. (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand. * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO, UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants. (tls_call_delay): New attribute. (in_call_delay): Use it. (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed. (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64, tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64, tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10, tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32, tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns. (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32, tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64, tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64, tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64, tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64, tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64, tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32, tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New insns. * config/sparc/sparc-protos.h (legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p, legitimize_tls_address, legitimize_address, tls_symbolic_operand, tls_call_delay, sparc_output_dwarf_dtprel): New prototypes. * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define. * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise. * configure.in (sparc*-*-*): Add TLS check. * configure: Rebuilt. From-SVN: r71202
2003-09-08 08:57:05 +02:00
#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
1992-01-30 21:58:19 +01:00
/* Should gcc use [%reg+%lo(xx)+offset] addresses? */
#ifdef HAVE_AS_OFFSETABLE_LO10
#define USE_AS_OFFSETABLE_LO10 1
#else
#define USE_AS_OFFSETABLE_LO10 0
#endif
1992-01-30 21:58:19 +01:00
/* Try a machine-dependent way of reloading an illegitimate address
operand. If we find one, push the reload and jump to WIN. This
macro is used in only one place: `find_reloads_address' in reload.c. */
#define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
do { \
int win; \
(X) = sparc_legitimize_reload_address ((X), (MODE), (OPNUM), \
(int)(TYPE), (IND_LEVELS), &win); \
if (win) \
goto WIN; \
} while (0)
1992-01-30 21:58:19 +01:00
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
/* If we ever implement any of the full models (such as CM_FULLANY),
this has to be DImode in that case */
#ifdef HAVE_GAS_SUBSECTION_ORDERING
#define CASE_VECTOR_MODE \
(! TARGET_PTR64 ? SImode : flag_pic ? SImode : TARGET_CM_MEDLOW ? SImode : DImode)
#else
/* If assembler does not have working .subsection -1, we use DImode for pic, as otherwise
we have to sign extend which slows things down. */
#define CASE_VECTOR_MODE \
(! TARGET_PTR64 ? SImode : flag_pic ? DImode : TARGET_CM_MEDLOW ? SImode : DImode)
#endif
1992-01-30 21:58:19 +01:00
/* Define this as 1 if `char' should by default be signed; else as 0. */
#define DEFAULT_SIGNED_CHAR 1
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX 8
1992-01-30 21:58:19 +01:00
/* If a memory-to-memory move would take MOVE_RATIO or more simple
builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. gcc/ChangeLog: * builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. * expr.c: Likewise. * expr.h: Likewise. * genopinit.c: Likewise. * integrate.c: Likewise. * local-alloc.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * config/alpha/alpha.h: Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm-protos.h: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.md: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.md: Likewise. * config/frv/frv.md: Likewise. * config/i386/i386-protos.h: Likewise. * config/i386/i386.c: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386.md: Likewise. * config/i860/i860.c: Likewise. * config/i860/i860.md: Likewise. * config/ip2k/ip2k.md: Likewise. * config/ip2k/libgcc.S: Likewise. * config/ip2k/t-ip2k: Likewise. * config/m32r/m32r.c: Likewise. * config/m32r/m32r.md: Likewise. * config/mcore/mcore.md: Likewise. * config/mips/mips.c: Likewise. * config/mips/mips.md: Likewise. * config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.h: Likewise. * config/ns32k/ns32k.md: Likewise. * config/pa/pa.c: Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.h: Likewise. * config/pdp11/pdp11.md: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rs6000/rs6000.md: Likewise. * config/s390/s390-protos.h: Likewise. * config/s390/s390.c: Likewise. * config/s390/s390.md: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/t-sh: Likewise. * config/sparc/sparc.h: Likewise. * config/vax/vax.md: Likewise. * config/xtensa/xtensa.c: Likewise. * config/xtensa/xtensa.md: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * doc/rtl.texi: Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/builtins/mempcpy-2.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. From-SVN: r84222
2004-07-07 21:25:01 +02:00
move-instruction pairs, we will do a movmem or libcall instead. */
#define MOVE_RATIO(speed) ((speed) ? 8 : 3)
/* Define if operations between registers always perform the operation
on the full register even if a narrower mode is specified. */
#define WORD_REGISTER_OPERATIONS
/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
will either zero-extend or sign-extend. The value of this macro should
be the code that says which one of the two operations is implicitly
done, UNKNOWN if none. */
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
1992-01-30 21:58:19 +01:00
/* Nonzero if access to memory by bytes is slow and undesirable.
For RISC chips, it means that access to memory by bytes is no
better than access by words when possible, so grab a whole word
and maybe make use of that. */
#define SLOW_BYTE_ACCESS 1
/* Define this to be nonzero if shift instructions ignore all but the low-order
few bits. */
#define SHIFT_COUNT_TRUNCATED 1
1992-01-30 21:58:19 +01:00
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* For SImode, we make sure the top 32-bits of the register are clear and
then we subtract 32 from the lzd instruction result. */
#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
((VALUE) = ((MODE) == SImode ? 32 : 64), 1)
1992-01-30 21:58:19 +01:00
/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
return the mode to be used for the comparison. For floating-point,
CCFP[E]mode is used. CC_NOOVmode should be used when the first operand
is a PLUS, MINUS, NEG, or ASHIFT. CCmode should be used when no special
processing is needed. */
#define SELECT_CC_MODE(OP,X,Y) select_cc_mode ((OP), (X), (Y))
1992-01-30 21:58:19 +01:00
/* Return nonzero if MODE implies a floating point inequality can be
reversed. For SPARC this is always true because we have a full
compliment of ordered and unordered comparisons, but until generic
code knows how to reverse it correctly we keep the old definition. */
#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode && (MODE) != CCFPmode)
/* A function address in a call instruction for indexing purposes. */
#define FUNCTION_MODE Pmode
1992-01-30 21:58:19 +01:00
/* Define this if addresses of constant functions
shouldn't be put through pseudo regs where they can be cse'd.
Desirable on machines where ordinary constants are expensive
but a CALL with constant address is cheap. */
#define NO_FUNCTION_CSE
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
/* The _Q_* comparison libcalls return booleans. */
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
/* Assume by default that the _Qp_* 64-bit libcalls are implemented such
that the inputs are fully consumed before the output memory is clobbered. */
#define TARGET_BUGGY_QP_LIB 0
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
/* Assume by default that we do not have the Solaris-specific conversion
routines nor 64-bit integer multiply and divide routines. */
#define SUN_CONVERSION_LIBFUNCS 0
#define DITF_CONVERSION_LIBFUNCS 0
#define SUN_INTEGER_MULTIPLY_64 0
/* Provide the cost of a branch. For pre-v9 processors we use
a value of 3 to take into account the potential annulling of
the delay slot (which ends up being a bubble in the pipeline slot)
plus a cycle to take into consideration the instruction cache
effects.
On v9 and later, which have branch prediction facilities, we set
it to the depth of the pipeline as that is the cost of a
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
mispredicted branch.
On Niagara, normal branches insert 3 bubbles into the pipe
and annulled branches insert 4 bubbles.
On Niagara-2 and Niagara-3, a not-taken branch costs 1 cycle whereas
a taken branch costs 6 cycles. */
#define BRANCH_COST(speed_p, predictable_p) \
((sparc_cpu == PROCESSOR_V9 \
|| sparc_cpu == PROCESSOR_ULTRASPARC) \
? 7 \
: (sparc_cpu == PROCESSOR_ULTRASPARC3 \
Sun Niagara specific optimizations. * config.gcc: Recognize niagara as target. * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. (TARGET_CPU_niagara): Define. (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. (PROCESSOR_NIAGARA): New enum entry. (REGISTER_MOVE_COST): Handle Niagara. (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. * config/sparc/sparc.c (niagara_costs): New processor_costs entry. (sparc_override_options): Recognize "niagara", set appropriate default MASK_* values for it, and align functions to 32-bytes by default just like ULTRASPARC/ULTRASPARC3. (sparc_initialize_trampoline): Handle niagara like ultrasparc. (sparc64_initialize_trampoline): Likewise. (sparc_use_sched_lookahead): Use zero for niagara. (sparc_issue_rate): Use one for niagara. * config/sparc/niagara.md: New file. * config/sparc/sparc.md: Include it. * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (CPP_CPU_SPEC): Handle -mcpu=niagara. (ASM_CPU_SPEC): Likewise. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately when default cpu is niagara. (ASM_CPU_SPEC): Handle -mcpu=niagara. * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara just like v9/ultrasparc/ultrasparc3. * doc/invoke.texi: Add documentation for "niagara" and improve existing documentation for ultrasparc variants. From-SVN: r111648
2006-03-02 23:47:02 +01:00
? 9 \
: (sparc_cpu == PROCESSOR_NIAGARA \
? 4 \
: ((sparc_cpu == PROCESSOR_NIAGARA2 \
|| sparc_cpu == PROCESSOR_NIAGARA3) \
? 5 \
: 3))))
1992-01-30 21:58:19 +01:00
/* Control the assembler format that we output. */
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will end at
the end of the line. */
#define ASM_COMMENT_START "!"
1992-01-30 21:58:19 +01:00
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
#define ASM_APP_ON ""
/* Output to assembler file text saying following lines
no longer contain unusual constructs. */
#define ASM_APP_OFF ""
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
#define REGISTER_NAMES \
{"%g0", "%g1", "%g2", "%g3", "%g4", "%g5", "%g6", "%g7", \
"%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%sp", "%o7", \
"%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
"%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%fp", "%i7", \
"%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7", \
"%f8", "%f9", "%f10", "%f11", "%f12", "%f13", "%f14", "%f15", \
"%f16", "%f17", "%f18", "%f19", "%f20", "%f21", "%f22", "%f23", \
"%f24", "%f25", "%f26", "%f27", "%f28", "%f29", "%f30", "%f31", \
"%f32", "%f33", "%f34", "%f35", "%f36", "%f37", "%f38", "%f39", \
"%f40", "%f41", "%f42", "%f43", "%f44", "%f45", "%f46", "%f47", \
"%f48", "%f49", "%f50", "%f51", "%f52", "%f53", "%f54", "%f55", \
"%f56", "%f57", "%f58", "%f59", "%f60", "%f61", "%f62", "%f63", \
Teach sparc backend about %gsr register and add intrinsics to access it. * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103. (SPARC_GSR_REG): Define. (FIXED_REGISTERS): Mark GSR as fixed. (CALL_USED_REGISTERS): Mark GSR as call used. (HARD_REGNO_NREGS): GSR is always 1 register. (REG_CLASS_CONTENTS): Add GSR to ALL_REGS. (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end. (REGISTER_NAMES): Add "%gsr". * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete. (UNSPEC_WRGSR): New unspec. (GSR_REG): New constant. (type): Add new insn type 'gsr'. (fpack16_vis, fpackfix_vis, fpack32_vis, faligndata<V64I:MODE>_vis)): Add use of GSR_REG. (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64, rdgsr_v8plus): New expanders and insns. (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement using patterns which show that this is a plus in addition to a modification of GSR_REG, instead of an unspec. * config/sparc/ultra1_2.md: Handle 'gsr'. * config/sparc/ultra3.md: Likewise. * config/sparc/niagara.md: Likewise. * config/sparc/niagara2.md: Likewise. * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out end of table. (sparc_option_override): Make -mvis imply -mv8plus. (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries for %gsr. (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and __builtin_vis_read_gsr. (sparc_expand_buildin): Handle builtins that take one argument and return void. (sparc_fold_builtin): Never fold writes to %gsr. * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New. * doc/extend.texi: Document new VIS intrinsics. From-SVN: r179159
2011-09-25 04:29:23 +02:00
"%fcc0", "%fcc1", "%fcc2", "%fcc3", "%icc", "%sfp", "%gsr" }
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
/* Define additional names for use in asm clobbers and asm declarations. */
sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. * sparc/sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define. (TARGET_SWITCHES): Add live-g0. (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101). (FIXED_REGISTERS,CALL_USED_REGISTERS): Update. (FIXED_REGISTERS): %g0 is fixed by default. (SPARC_{FIRST,LAST}_V9_FCC_REG): Define. (SPARC_{ICC,FCC}_REG): Define. (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8. (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc. (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'. (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc. (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case. (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg. (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise. (REGISTER_NAMES): Add %icc. (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG. * sparc/sparc.c (leaf_reg_remap): Add %icc=100. (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0. (fcc_reg_operand): Renamed from ccfp_reg_operand. Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match modes if `mode' argument is VOIDmode. (icc_or_fcc_reg_operand): New function. (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares. Use SPARC_ICC_REG for int compares. (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. Delete unnecessary test for %g0. (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if TARGET_LIVE_G0. (output_scc_insn): Label moved to operand 3. Condition code reg moved to operand 2. (sparc_mode_class): Enum C_MODE renamed to CC_MODE. (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc. (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc. (sparc_regno_reg_class): New global. (sparc_init_modes): Initialize it. (output_cbranch): Delete fp_cond_reg argument. (print_operand, MEM op): Don't print "%g0+" if TARGET_SPARCLET. (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0. * sparc/sparc.md (live_g0): New attribute. (*): Integer condition code register is now reg 100. Use SPARC_ICC_REG instead of hardcoding reg 100 where possible. Non-v9 floating point condition code register is now reg 96. (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases. (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch. (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0. (*mov{qi,hi,si}_insn_liveg0): New patterns. (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to fcc_reg_operand. (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if TARGET_LIVE_G0. (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2. (patterns that use %g0 in rs2): Use 0 immediate value instead. (patterns that read %g0): Don't use if TARGET_LIVE_G0. From-SVN: r11494
1996-03-08 01:12:21 +01:00
#define ADDITIONAL_REGISTER_NAMES \
{{"ccr", SPARC_ICC_REG}, {"cc", SPARC_ICC_REG}}
1997-04-23 02:39:04 +02:00
/* On Sun 4, this limit is 2048. We use 1000 to be safe, since the length
can run past this up to a continuation point. Once we used 1500, but
a single entry in C++ can run more than 500 bytes, due to the length of
mangled symbol names. dbxout.c should really be fixed to do
continuations when they are actually needed instead of trying to
guess... */
#define DBX_CONTIN_LENGTH 1000
1992-01-30 21:58:19 +01:00
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.global "
1992-01-30 21:58:19 +01:00
/* The prefix to add to user-visible assembler symbols. */
1992-01-30 21:58:19 +01:00
#define USER_LABEL_PREFIX "_"
1992-01-30 21:58:19 +01:00
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*%s%ld", (PREFIX), (long)(NUM))
1992-01-30 21:58:19 +01:00
/* This is how we hook in and defer the case-vector until the end of
the function. */
#define ASM_OUTPUT_ADDR_VEC(LAB,VEC) \
sparc_defer_case_vector ((LAB),(VEC), 0)
#define ASM_OUTPUT_ADDR_DIFF_VEC(LAB,VEC) \
sparc_defer_case_vector ((LAB),(VEC), 1)
1992-01-30 21:58:19 +01:00
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { \
char label[30]; \
ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
if (CASE_VECTOR_MODE == SImode) \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
fprintf (FILE, "\t.word\t"); \
else \
fprintf (FILE, "\t.xword\t"); \
assemble_name (FILE, label); \
fputc ('\n', FILE); \
} while (0)
1992-01-30 21:58:19 +01:00
/* This is how to output an element of a case-vector that is relative.
(SPARC uses such vectors only when generating PIC.) */
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do { \
char label[30]; \
ASM_GENERATE_INTERNAL_LABEL (label, "L", (VALUE)); \
if (CASE_VECTOR_MODE == SImode) \
sparc.h (cpu_type): New enum. * sparc/sparc.h (cpu_type): New enum. (CPP_PREDEFINES,CPP_SPEC): Add v9 support. (NO_BUILTIN_PTRDIFF_TYPE, NO_BUILTIN_SIZE_TYPE, MAX_WCHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_LONG_TYPE_SIZE): Define. (PTRDIFF_TYPE, SIZE_TYPE, BITS_PER_WORD, MAX_BITS_PER_WORD, UNITS_PER_WORD, MAX_UNITS_PER_WORD, LONG_DOUBLE_TYPE_SIZE, POINTER_SIZE, PARM_BOUNDARY, STACK_BOUNDARY, SPARC_STACK_ALIGN, EMPTY_FIELD_BOUNDARY, BIGGEST_ALIGNMENT, FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, CONDITIONAL_REGISTER_USAGE): Add v9 support. (sparc_override_options, sparc_code_model): Declare. (OVERRIDE_OPTIONS): Call it. (MASK_*): Define bits set by target flags. (TARGET_*): Use them. ({MASK,TARGET}_{V9,INT64,LONG64,PTR64,ENV32,STACK_BIAS, MEDLOW,MEDANY,FULLANY}): Define. (MEDANY_BASE_REG): Define. (V9_SWITCHES, TARGET_OPTIONS): Define. (TARGET_SWITCHES, TARGET_DEFAULT): Use MASK_*. (SPARC_STACK_BIAS, SECONDARY_MEMORY_NEEDED_MODE): Define. (SECONDARY_MEMORY_NEEDED): Simplify. (hard_regno_mode_class, sparc_mode_class, sparc_cpu_type): Declare. (REG_PARM_STACK_SPACE): Do not define if v9. (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, MODES_TIEABLE_P, RETURN_IN_MEMORY, STRUCT_VALUE, STRUCT_VALUE_INCOMING, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER, LEAF_REGISTERS, REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS, STARTING_FRAME_OFFSET, FIRST_PARM_OFFSET, BASE_RETURN_VALUE_REG, BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG, BASE_INCOMING_ARG_REG, FUNCTION_ARG_REGNO_P): Add v9 support. (sparc_arg_class): New enum (v9 only). (sparc_args): New struct to record v9 arguments. (CUMULATIVE_ARGS): Use it (v9 only). (GET_SPARC_ARG_CLASS): Define. (sparc_arg_count, sparc_n_named_args): Declare. (PASS_IN_REG_P): Define. (ROUND_REG, ROUND_ADVANCE, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG, FUNCTION_INCOMING_ARG, FUNCTION_ARG_PARTIAL_NREGS, FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Add v9 support. (sparc64_init_expanders, sparc64_fpconv_stack_temp): Declare. (INIT_EXPANDERS): Define (v9 only). (gen_v9_scc, output_v9branch): Declare. (HAVE_conditional_move): Define. (FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX, REGNO_OK_FOR_FP_P, REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P, EXTRA_CONSTRAINT, CASE_VECTOR_MODE, Pmode, EXTRA_CC_MODES, EXTRA_CC_NAMES, SELECT_CC_MODE, REGISTER_NAMES): Add v9 support. (REGNO_OK_FOR_CCFP_P): Define. (sparc_initialize_trampoline, sparc64_initialize_trampoline): Declare. (INITIALIZE_TRAMPOLINE): Call them. (ENCODE_SECTION_INFO): Mark functions in v9. (RTX_COSTS): Assume MULT costs the same for v9 as v8. (ASM_LONGLONG, ASM_FLOAT): Define. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Add v9 support. From-SVN: r7485
1994-06-15 09:46:50 +02:00
fprintf (FILE, "\t.word\t"); \
else \
fprintf (FILE, "\t.xword\t"); \
assemble_name (FILE, label); \
ASM_GENERATE_INTERNAL_LABEL (label, "L", (REL)); \
fputc ('-', FILE); \
assemble_name (FILE, label); \
fputc ('\n', FILE); \
} while (0)
1992-01-30 21:58:19 +01:00
/* This is what to output before and after case-vector (both
relative and absolute). If .subsection -1 works, we put case-vectors
at the beginning of the current section. */
#ifdef HAVE_GAS_SUBSECTION_ORDERING
#define ASM_OUTPUT_ADDR_VEC_START(FILE) \
fprintf(FILE, "\t.subsection\t-1\n")
#define ASM_OUTPUT_ADDR_VEC_END(FILE) \
fprintf(FILE, "\t.previous\n")
#endif
1992-01-30 21:58:19 +01:00
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", (1<<(LOG)))
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz> * expr.h (assemble_static_space): Update prototype. * output.h (assemble_zeros, output_constant): Likewise. * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make it 64bit clean. * elf.h (ASM_OTUPUT_SKIP): Likewise. * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. * aout.h (ASM_OTUPUT_SKIP): Likewise. * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. * frv.h (ASM_OTUPUT_SKIP): Likewise. * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m32r.h (ASM_OUTPUT_COMMON): Likewise. * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * sgs.h (ASM_OUTPUT_SKIP): Likewise. * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. * iris.h (ASM_OUTPUT_LOCAL): Likewise. * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * varasm.c (asm_output_bss, asm_output_aligned_bss, asm_emit_uninitialized, assemble_zeros, assemble_static_space): HOST_WIDE_INT argument From-SVN: r66713
2003-05-12 11:51:36 +02:00
fprintf (FILE, "\t.skip "HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))
1992-01-30 21:58:19 +01:00
/* This says how to output an assembler line
to define a global common symbol. */
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs ("\t.common ", (FILE)), \
1992-01-30 21:58:19 +01:00
assemble_name ((FILE), (NAME)), \
Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz> * expr.h (assemble_static_space): Update prototype. * output.h (assemble_zeros, output_constant): Likewise. * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make it 64bit clean. * elf.h (ASM_OTUPUT_SKIP): Likewise. * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. * aout.h (ASM_OTUPUT_SKIP): Likewise. * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. * frv.h (ASM_OTUPUT_SKIP): Likewise. * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m32r.h (ASM_OUTPUT_COMMON): Likewise. * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * sgs.h (ASM_OUTPUT_SKIP): Likewise. * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. * iris.h (ASM_OUTPUT_LOCAL): Likewise. * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * varasm.c (asm_output_bss, asm_output_aligned_bss, asm_emit_uninitialized, assemble_zeros, assemble_static_space): HOST_WIDE_INT argument From-SVN: r66713
2003-05-12 11:51:36 +02:00
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\"\n", (SIZE)))
1992-01-30 21:58:19 +01:00
/* This says how to output an assembler line to define a local common
symbol. */
1992-01-30 21:58:19 +01:00
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGNED) \
( fputs ("\t.reserve ", (FILE)), \
assemble_name ((FILE), (NAME)), \
Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz> * expr.h (assemble_static_space): Update prototype. * output.h (assemble_zeros, output_constant): Likewise. * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make it 64bit clean. * elf.h (ASM_OTUPUT_SKIP): Likewise. * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. * aout.h (ASM_OTUPUT_SKIP): Likewise. * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. * frv.h (ASM_OTUPUT_SKIP): Likewise. * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m32r.h (ASM_OUTPUT_COMMON): Likewise. * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * sgs.h (ASM_OUTPUT_SKIP): Likewise. * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. * iris.h (ASM_OUTPUT_LOCAL): Likewise. * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * varasm.c (asm_output_bss, asm_output_aligned_bss, asm_emit_uninitialized, assemble_zeros, assemble_static_space): HOST_WIDE_INT argument From-SVN: r66713
2003-05-12 11:51:36 +02:00
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\",%u\n", \
(SIZE), ((ALIGNED) / BITS_PER_UNIT)))
1992-01-30 21:58:19 +01:00
1997-07-16 21:05:27 +02:00
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
Try to use asm_output_aligned_bss to implement this macro. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
} while (0)
/* Output #ident as a .ident. */
target.def (output_ident): New hook. gcc/ * target.def (output_ident): New hook. * targhooks.h (default_asm_output_ident_directive): Add prototype. * varasm.c (assemble_asm): Only prefix a tab if the string does not already start with one. (default_asm_output_ident_directive): New function to emit .ident as a top-level asm node while parsing, or directly to asm_out_file after parsing. * toplev.c (compile_file): Print a GCC .ident with targetm.asm_out.output_ident. * doc/tm.texi.in (ASM_OUTPUT_IDENT): Remove documentation for macro. (TARGET_ASM_OUTPUT_IDENT): Add @hook for this. * doc/tm.texi: Update. * config/elfos.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/i386/djgpp.h (IDENT_ASM_OP): Remove. * config/i386/gas.h (ASM_OUTPUT_IDENT): Remove. * config/arm/aout.h (ASM_OUTPUT_IDENT): Remove. * config/sparc/sparc.h (IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/picochip/picochip.h (IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/cris/cris-protos.h (cris_asm_output_ident): Add prototype. * config/cris/cris.c (cris_asm_output_ident): New function. * config/cris/cris.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove. * config/microblaze/microblaze-protos.h (microblaze_asm_output_ident): Add prototype. * config/microblaze/microblaze.c: Include cgraph.h for add_asm_node. (microblaze_asm_output_ident): Rewrite to work similar to default_asm_output_ident_directive for front-end .idents. * config/microblaze/microblaze.h (ASM_OUTPUT_IDENT): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/mips/mips.h (ASM_OUTPUT_IDENT): Remove. * config/mips/sde.h (IDENT_ASM_OP, ASM_OUTPUT_IDENT): Remove. * config/rx/rx.c: Include cgraph.h for add_asm_node. (rx_asm_output_ident): New function, similar to default_asm_output_ident_directive, but handle AS100 syntax also, so that #ident also works for rx in AS100 syntax. (TARGET_ASM_OUTPUT_IDENT): Define. * config/rx/rx.h (IDENT_ASM_OP): Remove. * Makefile.in: Fix dependencies for c-family/c-lex.o. c-family/ * c-lex.c: Do not include output.h. (cb_ident): Try to put out .ident with targetm.asm_out.output_ident. Remove uses of ASM_OUTPUT_IDENT. ada/ * gcc-interface/trans.c: Include target.h. (gigi): Try to put out .ident with targetm.asm_out.output_ident. Remove uses of ASM_OUTPUT_IDENT. * gcc-interface/Make-lang.in: Fix dependencies. From-SVN: r188791
2012-06-19 21:55:33 +02:00
#undef TARGET_ASM_OUTPUT_IDENT
#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
/* Prettify the assembly. */
extern int sparc_indent_opcode;
#define ASM_OUTPUT_OPCODE(FILE, PTR) \
do { \
if (sparc_indent_opcode) \
{ \
putc (' ', FILE); \
sparc_indent_opcode = 0; \
} \
} while (0)
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
/* TLS support defaulting to original Sun flavor. GNU extensions
must be activated in separate configuration files. */
sparc.c (struct machine_function): New type. * config/sparc/sparc.c (struct machine_function): New type. (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. (sparc_override_options): Initialize init_machine_status. (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand): New functions. (symbolic_operand): Disallow tls_symbolic_operand. (symbolic_memory_operand): Likewise. (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p): New functions. (sparc_tls_symbol): New variable. (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address, legitimize_address): New functions. (print_operand): Handle %&. (sparc_init_machine_status, get_some_local_dynamic_name, get_some_local_dynamic_name_1): New functions. (sparc_output_dwarf_dtprel): New function. * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into constant_address_p. (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p. (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p. (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p. (LEGITIMIZE_ADDRESS): Moved into legitimize_address. (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define. (ASM_OUTPUT_DWARF_DTPREL): Define. (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand. * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO, UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants. (tls_call_delay): New attribute. (in_call_delay): Use it. (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed. (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64, tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64, tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10, tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32, tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns. (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32, tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64, tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64, tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64, tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64, tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64, tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32, tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New insns. * config/sparc/sparc-protos.h (legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p, legitimize_tls_address, legitimize_address, tls_symbolic_operand, tls_call_delay, sparc_output_dwarf_dtprel): New prototypes. * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define. * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise. * configure.in (sparc*-*-*): Add TLS check. * configure: Rebuilt. From-SVN: r71202
2003-09-08 08:57:05 +02:00
#ifdef HAVE_AS_TLS
#define TARGET_TLS 1
#else
#define TARGET_TLS 0
#endif
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
sparc.c (struct machine_function): New type. * config/sparc/sparc.c (struct machine_function): New type. (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. (sparc_override_options): Initialize init_machine_status. (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand): New functions. (symbolic_operand): Disallow tls_symbolic_operand. (symbolic_memory_operand): Likewise. (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p): New functions. (sparc_tls_symbol): New variable. (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address, legitimize_address): New functions. (print_operand): Handle %&. (sparc_init_machine_status, get_some_local_dynamic_name, get_some_local_dynamic_name_1): New functions. (sparc_output_dwarf_dtprel): New function. * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into constant_address_p. (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p. (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p. (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p. (LEGITIMIZE_ADDRESS): Moved into legitimize_address. (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define. (ASM_OUTPUT_DWARF_DTPREL): Define. (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand. * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO, UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants. (tls_call_delay): New attribute. (in_call_delay): Use it. (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed. (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64, tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64, tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10, tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32, tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns. (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32, tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64, tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64, tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64, tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64, tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64, tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32, tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New insns. * config/sparc/sparc-protos.h (legitimate_constant_p, constant_address_p, legitimate_pic_operand_p, legitimate_address_p, legitimize_tls_address, legitimize_address, tls_symbolic_operand, tls_call_delay, sparc_output_dwarf_dtprel): New prototypes. * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define. * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise. * configure.in (sparc*-*-*): Add TLS check. * configure: Rebuilt. From-SVN: r71202
2003-09-08 08:57:05 +02:00
#define TARGET_SUN_TLS TARGET_TLS
#define TARGET_GNU_TLS 0
#ifdef HAVE_AS_FMAF_HPC_VIS3
#define AS_NIAGARA3_FLAG "d"
#else
#define AS_NIAGARA3_FLAG "b"
#endif
Add support for sparc fused compare-and-branch. gcc/ 2012-11-15 David S. Miller <davem@davemloft.net> * configure.ac: Add check for assembler SPARC4 instruction support. * configure: Rebuild. * config.in: Add HAVE_AS_SPARC4 section. * config/sparc/sparc.opt (mcbcond): New option. * doc/invoke.texi: Document it. * config/sparc/constraints.md: New constraint 'A' for 5-bit signed immediates. * doc/md.texi: Document it. * config/sparc/sparc.c (dump_target_flag_bits): Handle MASK_CBCOND. (sparc_option_override): Likewise. (emit_cbcond_insn): New function. (emit_conditional_branch_insn): Call it. (emit_cbcond_nop): New function. (output_ubranch): Use cbcond, remove label arg. (output_cbcond): New function. * config/sparc/sparc-protos.h (output_ubranch): Update. (output_cbcond): Declare it. (emit_cbcond_nop): Likewise. * config/sparc/sparc.md (type attribute): New types 'cbcond' and uncond_cbcond. (emit_cbcond_nop): New attribute. (length attribute): Handle cbcond and uncond_cbcond. (in_call_delay attribute): Reject cbcond and uncond_cbcond. (in_branch_delay attribute): Likewise. (in_uncond_branch_delay attribute): Likewise. (in_annul_branch_delay attribute): Likewise. (*cbcond_sp32, *cbcond_sp64): New insn patterns. (jump): Rewrite into an expander. (*jump_ubranch, *jump_cbcond): New patterns. * config/sparc/niagara4.md: Match 'cbcond' in 'n4_cti'. * config/sparc/sparc.h (AS_NIAGARA4_FLAG): New macro, use it when target default is niagara4. (SPARC_SIMM5_P): Define. * config/sparc/sol2.h (AS_SPARC64_FLAG): Adjust. (AS_SPARC32_FLAG): Define. (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Use AS_NIAGARA4_FLAG as needed. From-SVN: r193543
2012-11-15 22:24:22 +01:00
#ifdef HAVE_AS_SPARC4
#define AS_NIAGARA4_FLAG "-xarch=sparc4"
#else
#define AS_NIAGARA4_FLAG "-Av9" AS_NIAGARA3_FLAG
#endif
#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
#define AS_LEONV7_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
#define AS_LEONV7_FLAG "-Av7"
#endif
/* We use gcc _mcount for profiling. */
#define NO_PROFILE_COUNTERS 0
/* Debug support */
#define MASK_DEBUG_OPTIONS 0x01 /* debug option handling */
#define MASK_DEBUG_ALL MASK_DEBUG_OPTIONS
#define TARGET_DEBUG_OPTIONS (sparc_debug & MASK_DEBUG_OPTIONS)
/* By default, use the weakest memory model for the cpu. */
#ifndef SUBTARGET_DEFAULT_MEMORY_MODEL
#define SUBTARGET_DEFAULT_MEMORY_MODEL SMM_DEFAULT
#endif
/* Define this to 1 if the FE_EXCEPT values defined in fenv.h start at 1. */
#define SPARC_LOW_FE_EXCEPT_VALUES 0