Turn HARD_REGNO_NREGS into a target hook

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 12 September 2017 09:29 EDT

2017-09-12 Richard Sandiford Alan Hayward David Sherwood

gcc/
- target.def (hard_regno_nregs): New hook. (class_max_nregs): Refer to it instead of HARD_REGNO_NREGS.
- targhooks.h (default_hard_regno_nregs): Declare.
- targhooks.c (default_hard_regno_nregs): New function.
- doc/tm.texi.in (HARD_REGNO_NREGS): Replace with... (TARGET_HARD_REGNO_NREGS): ...this hook. (HARD_REGNO_NREGS_HAS_PADDING): Update accordingly. (CLASS_MAX_NREGS): Likewise.
- doc/tm.texi: Regenerate.
- reginfo.c (init_reg_modes_target): Use targetm.hard_regno_nregs instead of HARD_REGNO_NREGS.
- rtl.h (REG_NREGS): Refer to TARGET_HARD_REGNO_NREGS rather than HARD_REGNO_NREGS in the comment.
- config/aarch64/aarch64.h (HARD_REGNO_NREGS): Delete.
- config/aarch64/aarch64-protos.h (aarch64_hard_regno_nregs): Delete.
- config/aarch64/aarch64.c (aarch64_hard_regno_nregs): Make static. Return an unsigned int. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/alpha/alpha.h (HARD_REGNO_NREGS): Delete.
- config/arc/arc.h (HARD_REGNO_NREGS): Delete.
- config/arc/arc.c (TARGET_HARD_REGNO_NREGS): Redefine. (arc_hard_regno_nregs): New function.
- config/arm/arm.h (HARD_REGNO_NREGS): Delete.
- config/arm/arm.c (TARGET_HARD_REGNO_NREGS): Redefine. (arm_hard_regno_nregs): New function.
- config/avr/avr.h (HARD_REGNO_NREGS): Delete.
- config/bfin/bfin.h (HARD_REGNO_NREGS): Delete.
- config/bfin/bfin.c (bfin_hard_regno_nregs): New function. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/c6x/c6x.h (HARD_REGNO_NREGS): Delete.
- config/cr16/cr16.h (LONG_REG_P): Use targetm.hard_regno_nregs. (HARD_REGNO_NREGS): Delete.
- config/cr16/cr16.c (TARGET_HARD_REGNO_NREGS): Redefine. (cr16_hard_regno_nregs): New function. (cr16_memory_move_cost): Use it instead of HARD_REGNO_NREGS.
- config/cris/cris.h (HARD_REGNO_NREGS): Delete.
- config/cris/cris.c (TARGET_HARD_REGNO_NREGS): Redefine. (cris_hard_regno_nregs): New function.
- config/epiphany/epiphany.h (HARD_REGNO_NREGS): Delete.
- config/fr30/fr30.h (HARD_REGNO_NREGS): Delete. (CLASS_MAX_NREGS): Use targetm.hard_regno_nregs.
- config/frv/frv.h (HARD_REGNO_NREGS): Delete. (CLASS_MAX_NREGS): Remove outdated copy of documentation.
- config/frv/frv-protos.h (frv_hard_regno_nregs): Delete.
- config/frv/frv.c (TARGET_HARD_REGNO_NREGS): Redefine. (frv_hard_regno_nregs): Make static. Take and return an unsigned int. (frv_class_max_nregs): Remove outdated copy of documentation.
- config/ft32/ft32.h (HARD_REGNO_NREGS): Delete.
- config/h8300/h8300.h (HARD_REGNO_NREGS): Delete.
- config/h8300/h8300-protos.h (h8300_hard_regno_nregs): Delete.
- config/h8300/h8300.c (h8300_hard_regno_nregs): Delete.
- config/i386/i386.h (HARD_REGNO_NREGS): Delete.
- config/i386/i386.c (ix86_hard_regno_nregs): New function. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/ia64/ia64.h (HARD_REGNO_NREGS): Delete. (CLASS_MAX_NREGS): Update comment.
- config/ia64/ia64.c (TARGET_HARD_REGNO_NREGS): Redefine. (ia64_hard_regno_nregs): New function.
- config/iq2000/iq2000.h (HARD_REGNO_NREGS): Delete.
- config/lm32/lm32.h (HARD_REGNO_NREGS): Delete.
- config/m32c/m32c.h (HARD_REGNO_NREGS): Delete.
- config/m32c/m32c-protos.h (m32c_hard_regno_nregs): Delete.
- config/m32c/m32c.c (m32c_hard_regno_nregs_1): Take and return an unsigned int. (m32c_hard_regno_nregs): Likewise. Make static. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/m32r/m32r.h (HARD_REGNO_NREGS): Delete.
- config/m68k/m68k.h (HARD_REGNO_NREGS): Delete.
- config/m68k/m68k.c (TARGET_HARD_REGNO_NREGS): Redefine. (m68k_hard_regno_nregs): New function.
- config/mcore/mcore.h (HARD_REGNO_NREGS): Delete.
- config/microblaze/microblaze.h (HARD_REGNO_NREGS): Delete.
- config/mips/mips.h (HARD_REGNO_NREGS): Delete.
- config/mips/mips-protos.h (mips_hard_regno_nregs): Delete.
- config/mips/mips.c (mips_hard_regno_nregs): Make static. Take and return an unsigned int. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/mmix/mmix.h (HARD_REGNO_NREGS): Delete. (CLASS_MAX_NREGS): Use targetm.hard_regno_nregs.
- config/mn10300/mn10300.h (HARD_REGNO_NREGS): Delete.
- config/moxie/moxie.h (HARD_REGNO_NREGS): Delete.
- config/msp430/msp430.h (HARD_REGNO_NREGS): Delete.
- config/msp430/msp430-protos.h (msp430_hard_regno_nregs): Delete.
- config/msp430/msp430.c (TARGET_HARD_REGNO_NREGS): Redefine. (msp430_hard_regno_nregs): Make static. Take and return an unsigned int.
- config/nds32/nds32.h (HARD_REGNO_NREGS): Delete.
- config/nds32/nds32-protos.h (nds32_hard_regno_nregs): Delete.
- config/nds32/nds32.c (nds32_hard_regno_nregs): Delete. (nds32_hard_regno_mode_ok): Use targetm.hard_regno_nregs.
- config/nios2/nios2.h (HARD_REGNO_NREGS): Delete.
- config/nvptx/nvptx.h (HARD_REGNO_NREGS): Delete.
- config/nvptx/nvptx.c (nvptx_hard_regno_nregs): New function. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/pa/pa32-regs.h (HARD_REGNO_NREGS): Rename to... (PA_HARD_REGNO_NREGS): ...this.
- config/pa/pa64-regs.h (HARD_REGNO_NREGS): Rename to... (PA_HARD_REGNO_NREGS): ...this.
- config/pa/pa.c (TARGET_HARD_REGNO_NREGS): Redefine. (pa_hard_regno_nregs): New function.
- config/pdp11/pdp11.h (HARD_REGNO_NREGS): Delete.
- config/pdp11/pdp11.c (TARGET_HARD_REGNO_NREGS): Redefine. (pdp11_hard_regno_nregs): New function.
- config/powerpcspe/powerpcspe.h (HARD_REGNO_NREGS): Delete.
- config/powerpcspe/powerpcspe.c (TARGET_HARD_REGNO_NREGS): Redefine. (rs6000_hard_regno_nregs_hook): New function.
- config/riscv/riscv.h (HARD_REGNO_NREGS): Delete.
- config/riscv/riscv-protos.h (riscv_hard_regno_nregs): Delete.
- config/riscv/riscv.c (riscv_hard_regno_nregs): Make static. Take and return an unsigned int. Move earlier in file. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/rl78/rl78.h (HARD_REGNO_NREGS): Delete.
- config/rl78/rl78-protos.h (rl78_hard_regno_nregs): Delete.
- config/rl78/rl78.c (TARGET_HARD_REGNO_NREGS): Reefine. (rl78_hard_regno_nregs): Make static. Take and return an unsigned int.
- config/rs6000/rs6000.h (HARD_REGNO_NREGS): Delete.
- config/rs6000/rs6000.c (TARGET_HARD_REGNO_NREGS): Redefine. (rs6000_hard_regno_nregs_hook): New function.
- config/rx/rx.h (HARD_REGNO_NREGS): Delete.
- config/rx/rx.c (rx_hard_regno_nregs): New function. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/s390/s390.h (HARD_REGNO_NREGS): Delete.
- config/s390/s390.c (REGNO_PAIR_OK): Use s390_hard_regno_nregs instead of HARD_REGNO_NREGS. (s390_hard_regno_nregs): New function. (s390_hard_regno_mode_ok): Add comment from s390.h. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/sh/sh.h (HARD_REGNO_NREGS): Delete.
- config/sh/sh.c (TARGET_HARD_REGNO_NREGS): Redefine. (sh_hard_regno_nregs): New function. (sh_pass_in_reg_p): Use it.
- config/sparc/sparc.h (HARD_REGNO_NREGS): Delete.
- config/sparc/sparc.c (TARGET_HARD_REGNO_NREGS): Redefine. (sparc_hard_regno_nregs): New function.
- config/spu/spu.h (HARD_REGNO_NREGS): Delete.
- config/spu/spu.c (spu_hard_regno_nregs): New function. (spu_function_arg_advance): Use it, supplying a valid register number. (TARGET_HARD_REGNO_NREGS): Redefine.
- config/stormy16/stormy16.h (HARD_REGNO_NREGS): Delete.
- config/tilegx/tilegx.h (HARD_REGNO_NREGS): Delete.
- config/tilepro/tilepro.h (HARD_REGNO_NREGS): Delete.
- config/v850/v850.h (HARD_REGNO_NREGS): Delete.
- config/vax/vax.h (HARD_REGNO_NREGS): Delete.
- config/visium/visium.h (HARD_REGNO_NREGS): Delete. (CLASS_MAX_NREGS): Remove copy of old documentation.
- config/visium/visium.c (TARGET_HARD_REGNO_NREGS): Redefine. (visium_hard_regno_nregs): New function. (visium_hard_regno_mode_ok): Use it instead of HARD_REGNO_NREGS.
- config/xtensa/xtensa.h (HARD_REGNO_NREGS): Delete.
- config/xtensa/xtensa.c (TARGET_HARD_REGNO_NREGS): Redefine. xtensa_hard_regno_nregs): New function.
- system.h (HARD_REGNO_NREGS): Poison.

74f68e4 Turn HARD_REGNO_NREGS into a target hook
gcc/ChangeLog | 159 ++++++++++++++++++++++++++++++++++++
gcc/config/aarch64/aarch64-protos.h | 1 -
gcc/config/aarch64/aarch64.c | 6 +-
gcc/config/aarch64/aarch64.h | 2 -
gcc/config/alpha/alpha.h | 8 --
gcc/config/arc/arc.c | 15 ++++
gcc/config/arc/arc.h | 9 --
gcc/config/arm/arm.c | 18 ++++
gcc/config/arm/arm.h | 14 ----
gcc/config/avr/avr.h | 3 -
gcc/config/bfin/bfin.c | 14 ++++
gcc/config/bfin/bfin.h | 5 --
gcc/config/c6x/c6x.h | 5 --
gcc/config/cr16/cr16.c | 14 +++-
gcc/config/cr16/cr16.h | 8 +-
gcc/config/cris/cris.c | 16 ++++
gcc/config/cris/cris.h | 8 --
gcc/config/epiphany/epiphany.h | 7 --
gcc/config/fr30/fr30.h | 20 +----
gcc/config/frv/frv-protos.h | 1 -
gcc/config/frv/frv.c | 31 ++-----
gcc/config/frv/frv.h | 27 ------
gcc/config/ft32/ft32.h | 7 --
gcc/config/h8300/h8300-protos.h | 1 -
gcc/config/h8300/h8300.c | 11 ---
gcc/config/h8300/h8300.h | 3 -
gcc/config/i386/i386.c | 28 +++++++
gcc/config/i386/i386.h | 19 -----
gcc/config/ia64/ia64.c | 27 ++++++
gcc/config/ia64/ia64.h | 18 +---
gcc/config/iq2000/iq2000.h | 4 -
gcc/config/lm32/lm32.h | 3 -
gcc/config/m32c/m32c-protos.h | 1 -
gcc/config/m32c/m32c.c | 14 ++--
gcc/config/m32c/m32c.h | 1 -
gcc/config/m32r/m32r.h | 7 --
gcc/config/m68k/m68k.c | 17 ++++
gcc/config/m68k/m68k.h | 7 --
gcc/config/mcore/mcore.h | 9 --
gcc/config/microblaze/microblaze.h | 3 -
gcc/config/mips/mips-protos.h | 1 -
gcc/config/mips/mips.c | 8 +-
gcc/config/mips/mips.h | 2 -
gcc/config/mmix/mmix.h | 8 +-
gcc/config/mn10300/mn10300.h | 9 --
gcc/config/moxie/moxie.h | 7 --
gcc/config/msp430/msp430-protos.h | 1 -
gcc/config/msp430/msp430.c | 10 +--
gcc/config/msp430/msp430.h | 3 -
gcc/config/nds32/nds32-protos.h | 7 --
gcc/config/nds32/nds32.c | 9 +-
gcc/config/nds32/nds32.h | 4 -
gcc/config/nios2/nios2.h | 3 -
gcc/config/nvptx/nvptx.c | 11 +++
gcc/config/nvptx/nvptx.h | 2 -
gcc/config/pa/pa.c | 11 +++
gcc/config/pa/pa32-regs.h | 2 +-
gcc/config/pa/pa64-regs.h | 2 +-
gcc/config/pdp11/pdp11.c | 12 +++
gcc/config/pdp11/pdp11.h | 12 ---
gcc/config/powerpcspe/powerpcspe.c | 10 +++
gcc/config/powerpcspe/powerpcspe.h | 5 --
gcc/config/riscv/riscv-protos.h | 1 -
gcc/config/riscv/riscv.c | 26 +++---
gcc/config/riscv/riscv.h | 2 -
gcc/config/rl78/rl78-protos.h | 1 -
gcc/config/rl78/rl78.c | 8 +-
gcc/config/rl78/rl78.h | 4 -
gcc/config/rs6000/rs6000.c | 10 +++
gcc/config/rs6000/rs6000.h | 5 --
gcc/config/rx/rx.c | 10 +++
gcc/config/rx/rx.h | 4 -
gcc/config/s390/s390.c | 31 ++++++-
gcc/config/s390/s390.h | 23 ------
gcc/config/sh/sh.c | 16 +++-
gcc/config/sh/sh.h | 11 ---
gcc/config/sparc/sparc.c | 25 ++++++
gcc/config/sparc/sparc.h | 19 -----
gcc/config/spu/spu.c | 13 ++-
gcc/config/spu/spu.h | 6 --
gcc/config/stormy16/stormy16.h | 6 --
gcc/config/tilegx/tilegx.h | 3 -
gcc/config/tilepro/tilepro.h | 3 -
gcc/config/v850/v850.h | 9 --
gcc/config/vax/vax.h | 8 --
gcc/config/visium/visium.c | 17 +++-
gcc/config/visium/visium.h | 22 -----
gcc/config/xtensa/xtensa.c | 13 +++
gcc/config/xtensa/xtensa.h | 7 --
gcc/doc/tm.texi | 29 +++----
gcc/doc/tm.texi.in | 24 +-----
gcc/reginfo.c | 2 +-
gcc/rtl.h | 2 +-
gcc/system.h | 3 +-
gcc/target.def | 19 ++++-
gcc/targhooks.c | 8 ++
gcc/targhooks.h | 1 +
97 files changed, 582 insertions(+), 519 deletions(-)

Upstream: gcc.gnu.org


  • Share