Turn TRULY_NOOP_TRUNCATION into a hook
authorRichard Sandiford <richard.sandiford@linaro.org>
Fri, 15 Sep 2017 13:47:41 +0000 (13:47 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 15 Sep 2017 13:47:41 +0000 (13:47 +0000)
commitbb149ca2e912038dce733f95ab1c24ff0d1af280
tree0bb537d68bc00b31b84974e82a6633ac494aa4bc
parenta75c63e02ab97abaaaf3508a25f8d87362ea238a
Turn TRULY_NOOP_TRUNCATION into a hook

I'm not sure the documentation is correct that outprec is always less
than inprec, and each non-default implementation tested for the case
in which it wasn't, but the patch leaves it as-is.

The SH port had a couple of TRULY_NOOP_TRUNCATION tests that were left
over from the old shmedia port.

2017-09-13  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayard  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* target.def (truly_noop_truncation): New hook.
(mode_rep_extended): Refer to TARGET_TRULY_NOOP_TRUNCATION rather
than TRULY_NOOP_TRUNCATION.
* hooks.h (hook_bool_uint_uint_true): Declare.
* hooks.c (hook_bool_uint_uint_true): New function.
* doc/tm.texi.in (TRULY_NOOP_TRUNCATION): Replace with...
(TARGET_TRULY_NOOP_TRUNCATION): ...this.
* doc/tm.texi: Regenerate.
* combine.c (make_extraction): Refer to TARGET_TRULY_NOOP_TRUNCATION
rather than TRULY_NOOP_TRUNCATION in comments.
(simplify_comparison): Likewise.
(record_truncated_value): Likewise.
* expmed.c (extract_bit_field_1): Likewise.
(extract_split_bit_field): Likewise.
* convert.c (convert_to_integer_1): Use targetm.truly_noop_truncation
instead of TRULY_NOOP_TRUNCATION.
* function.c (assign_parm_setup_block): Likewise.
* machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): Likewise.
* rtlhooks.c: Include target.h.
* config/aarch64/aarch64.h (TRULY_NOOP_TRUNCATION): Delete.
* config/alpha/alpha.h (TRULY_NOOP_TRUNCATION): Delete.
* config/arc/arc.h (TRULY_NOOP_TRUNCATION): Delete.
* config/arm/arm.h (TRULY_NOOP_TRUNCATION): Delete.
* config/avr/avr.h (TRULY_NOOP_TRUNCATION): Delete.
* config/bfin/bfin.h (TRULY_NOOP_TRUNCATION): Delete.
* config/c6x/c6x.h (TRULY_NOOP_TRUNCATION): Delete.
* config/cr16/cr16.h (TRULY_NOOP_TRUNCATION): Delete.
* config/cris/cris.h (TRULY_NOOP_TRUNCATION): Delete.
* config/epiphany/epiphany.h (TRULY_NOOP_TRUNCATION): Delete.
* config/fr30/fr30.h (TRULY_NOOP_TRUNCATION): Delete.
* config/frv/frv.h (TRULY_NOOP_TRUNCATION): Delete.
* config/ft32/ft32.h (TRULY_NOOP_TRUNCATION): Delete.
* config/h8300/h8300.h (TRULY_NOOP_TRUNCATION): Delete.
* config/i386/i386.h (TRULY_NOOP_TRUNCATION): Delete.
* config/ia64/ia64.h (TRULY_NOOP_TRUNCATION): Delete.
* config/iq2000/iq2000.h (TRULY_NOOP_TRUNCATION): Delete.
* config/lm32/lm32.h (TRULY_NOOP_TRUNCATION): Delete.
* config/m32c/m32c.h (TRULY_NOOP_TRUNCATION): Delete.
* config/m32r/m32r.h (TRULY_NOOP_TRUNCATION): Delete.
* config/m68k/m68k.h (TRULY_NOOP_TRUNCATION): Delete.
* config/mcore/mcore.h (TRULY_NOOP_TRUNCATION): Delete.
* config/microblaze/microblaze.h (TRULY_NOOP_TRUNCATION): Delete.
* config/mips/mips.h (TRULY_NOOP_TRUNCATION): Delete.
* config/mips/mips.c (mips_truly_noop_truncation): New function.
(TARGET_TRULY_NOOP_TRUNCATION): Redefine.
* config/mips/mips.md: Refer to TARGET_TRULY_NOOP_TRUNCATION
rather than TRULY_NOOP_TRUNCATION in comments.
* config/mmix/mmix.h (TRULY_NOOP_TRUNCATION): Delete.
* config/mn10300/mn10300.h (TRULY_NOOP_TRUNCATION): Delete.
* config/moxie/moxie.h (TRULY_NOOP_TRUNCATION): Delete.
* config/msp430/msp430.h (TRULY_NOOP_TRUNCATION): Delete.
* config/nds32/nds32.h (TRULY_NOOP_TRUNCATION): Delete.
* config/nios2/nios2.h (TRULY_NOOP_TRUNCATION): Delete.
* config/nvptx/nvptx.h (TRULY_NOOP_TRUNCATION): Delete.
* config/pa/pa.h (TRULY_NOOP_TRUNCATION): Delete.
* config/pdp11/pdp11.h (TRULY_NOOP_TRUNCATION): Delete.
* config/powerpcspe/powerpcspe.h (TRULY_NOOP_TRUNCATION): Delete.
* config/riscv/riscv.h (TRULY_NOOP_TRUNCATION): Delete.
* config/riscv/riscv.md: Refer to TARGET_TRULY_NOOP_TRUNCATION
rather than TRULY_NOOP_TRUNCATION in comments.
* config/rl78/rl78.h (TRULY_NOOP_TRUNCATION): Delete.
* config/rs6000/rs6000.h (TRULY_NOOP_TRUNCATION): Delete.
* config/rx/rx.h (TRULY_NOOP_TRUNCATION): Delete.
* config/s390/s390.h (TRULY_NOOP_TRUNCATION): Delete.
* config/sh/sh.h (MAYBE_BASE_REGISTER_RTX_P): Remove
TRULY_NOOP_TRUNCATION condition.
(MAYBE_INDEX_REGISTER_RTX_P): Likewise.
(TRULY_NOOP_TRUNCATION): Delete.
* config/sparc/sparc.h (TRULY_NOOP_TRUNCATION): Delete.
* config/spu/spu.h (TRULY_NOOP_TRUNCATION): Delete.
* config/spu/spu.c (spu_truly_noop_truncation): New function.
(TARGET_TRULY_NOOP_TRUNCATION): Redefine.
* config/stormy16/stormy16.h (TRULY_NOOP_TRUNCATION): Delete.
* config/tilegx/tilegx.h (TRULY_NOOP_TRUNCATION): Delete.
* config/tilegx/tilegx.c (tilegx_truly_noop_truncation): New fuction.
(TARGET_TRULY_NOOP_TRUNCATION): Redefine.
* config/tilegx/tilegx.md: Refer to TARGET_TRULY_NOOP_TRUNCATION
rather than TRULY_NOOP_TRUNCATION in comments.
* config/tilepro/tilepro.h (TRULY_NOOP_TRUNCATION): Delete.
* config/v850/v850.h (TRULY_NOOP_TRUNCATION): Delete.
* config/vax/vax.h (TRULY_NOOP_TRUNCATION): Delete.
* config/visium/visium.h (TRULY_NOOP_TRUNCATION): Delete.
* config/xtensa/xtensa.h (TRULY_NOOP_TRUNCATION): Delete.
* system.h (TRULY_NOOP_TRUNCATION): Poison.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r252818
68 files changed:
gcc/ChangeLog
gcc/combine.c
gcc/config/aarch64/aarch64.h
gcc/config/alpha/alpha.h
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/avr/avr.h
gcc/config/bfin/bfin.h
gcc/config/c6x/c6x.h
gcc/config/cr16/cr16.h
gcc/config/cris/cris.h
gcc/config/epiphany/epiphany.h
gcc/config/fr30/fr30.h
gcc/config/frv/frv.h
gcc/config/ft32/ft32.h
gcc/config/h8300/h8300.h
gcc/config/i386/i386.h
gcc/config/ia64/ia64.h
gcc/config/iq2000/iq2000.h
gcc/config/lm32/lm32.h
gcc/config/m32c/m32c.h
gcc/config/m32r/m32r.h
gcc/config/m68k/m68k.h
gcc/config/mcore/mcore.h
gcc/config/microblaze/microblaze.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.md
gcc/config/mmix/mmix.h
gcc/config/mn10300/mn10300.h
gcc/config/moxie/moxie.h
gcc/config/msp430/msp430.h
gcc/config/nds32/nds32.h
gcc/config/nios2/nios2.h
gcc/config/nvptx/nvptx.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/powerpcspe/powerpcspe.h
gcc/config/riscv/riscv.h
gcc/config/riscv/riscv.md
gcc/config/rl78/rl78.h
gcc/config/rs6000/rs6000.h
gcc/config/rx/rx.h
gcc/config/s390/s390.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/spu/spu.c
gcc/config/spu/spu.h
gcc/config/stormy16/stormy16.h
gcc/config/tilegx/tilegx.c
gcc/config/tilegx/tilegx.h
gcc/config/tilegx/tilegx.md
gcc/config/tilepro/tilepro.h
gcc/config/v850/v850.h
gcc/config/vax/vax.h
gcc/config/visium/visium.h
gcc/config/xtensa/xtensa.h
gcc/convert.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/expmed.c
gcc/function.c
gcc/hooks.c
gcc/hooks.h
gcc/machmode.h
gcc/rtlhooks.c
gcc/system.h
gcc/target.def