summaryrefslogtreecommitdiff
path: root/gcc/hooks.c
AgeCommit message (Collapse)Author
2020-01-09Add a compatible_vector_types_p target hookRichard Sandiford
One problem with adding an N-bit vector extension to an existing architecture is to decide how N-bit vectors should be passed to functions and returned from functions. Allowing all N-bit vector types to be passed in registers breaks backwards compatibility, since N-bit vectors could be used (and emulated) before the vector extension was added. But always passing N-bit vectors on the stack would be inefficient for things like vector libm functions. For SVE we took the compromise position of predefining new SVE vector types that are distinct from all existing vector types, including GNU-style vectors. The new types are passed and returned in an efficient way while existing vector types are passed and returned in the traditional way. In the right circumstances, the two types are inter-convertible. The SVE types are created using: vectype = build_distinct_type_copy (vectype); SET_TYPE_STRUCTURAL_EQUALITY (vectype); TYPE_ARTIFICIAL (vectype) = 1; The C frontend maintains this distinction, using VIEW_CONVERT_EXPR to convert from one type to the other. However, the distinction can be lost during gimple, which treats two vector types with the same mode, number of elements, and element type as equivalent. And for most targets that's the right thing to do. This patch therefore adds a hook that lets the target choose whether such vector types are indeed equivalent. Note that the new tests fail for -mabi=ilp32 in the same way as other ACLE-based tests. I'm still planning to fix that as a follow-on. 2020-01-09 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (compatible_vector_types_p): New target hook. * hooks.h (hook_bool_const_tree_const_tree_true): Declare. * hooks.c (hook_bool_const_tree_const_tree_true): New function. * doc/tm.texi.in (TARGET_COMPATIBLE_VECTOR_TYPES_P): New hook. * doc/tm.texi: Regenerate. * gimple-expr.c: Include target.h. (useless_type_conversion_p): Use targetm.compatible_vector_types_p. * config/aarch64/aarch64.c (aarch64_compatible_vector_types_p): New function. (TARGET_COMPATIBLE_VECTOR_TYPES_P): Define. * config/aarch64/aarch64-sve-builtins.cc (gimple_folder::convert_pred): Use the original predicate if it already has a suitable type. gcc/testsuite/ * gcc.target/aarch64/sve/pcs/gnu_vectors_1.c: New test. * gcc.target/aarch64/sve/pcs/gnu_vectors_2.c: Likewise. From-SVN: r280047
2020-01-01Update copyright years.Jakub Jelinek
From-SVN: r279813
2019-11-01OpenMP] use_device_addr/use_device_ptr with Fortran allocatable/pointer arraysTobias Burnus
gcc/fortran/ * f95-lang.c (LANG_HOOKS_OMP_ARRAY_DATA): Set to gfc_omp_array_data. * trans-array.c (gfc_conv_descriptor_data_get): Handle also REFERENCE_TYPE. * trans-openmp.c (gfc_omp_array_data): New. * trans.h (gfc_omp_array_data): New prototype. gcc/ * hooks.c (hook_tree_tree_bool_null): New. * hooks.h (hook_tree_tree_bool_null): Declare. * langhooks-def.h (LANG_HOOKS_OMP_ARRAY_DATA): Define. (LANG_HOOKS_DECLS): Add it. * langhooks.h (lang_hooks_for_decls): Add omp_array_data. * omp-low.c (install_var_field): New mode for Fortran descriptor arrays. (lower_omp_target): Handle Fortran array with descriptor in OMP_CLAUSE_USE_DEVICE_ADDR/OMP_CLAUSE_USE_DEVICE_PTR. libgomp/ * testsuite/libgomp.fortran/use_device_addr-1.f90 (test_nullptr_1, test_dummy_opt_nullptr_callee_1): Add present but unallocated test. * testsuite/libgomp.fortran/use_device_addr-2.f90: Likewise. * testsuite/libgomp.fortran/use_device_addr-3.f90: New. * testsuite/libgomp.fortran/use_device_addr-4.f90: New. * testsuite/testsuite/libgomp.fortran/use_device_ptr-1.f90: New. From-SVN: r277705
2019-09-30Pass an ABI identifier to hard_regno_call_part_clobberedRichard Sandiford
This patch replaces the rtx_insn argument to targetm.hard_regno_call_part_clobbered with an ABI identifier, since call insns are now just one possible way of getting an ABI handle. This in turn allows predefined_function_abi::initialize to do the right thing for non-default ABIs. The horrible ?: in need_for_call_save_p goes away in a later patch, with the series as a whole removing most direct calls to the hook in favour of function_abi operations. 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (hard_regno_call_part_clobbered): Take an ABI identifier instead of an rtx_insn. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_insn_uint_mode_false): Delete. (hook_bool_uint_uint_mode_false): New function. * hooks.c (hook_bool_insn_uint_mode_false): Delete. (hook_bool_uint_uint_mode_false): New function. * config/aarch64/aarch64.c (aarch64_hard_regno_call_part_clobbered): Take an ABI identifier instead of an rtx_insn. * config/avr/avr.c (avr_hard_regno_call_part_clobbered): Likewise. * config/i386/i386.c (ix86_hard_regno_call_part_clobbered): Likewise. * config/mips/mips.c (mips_hard_regno_call_part_clobbered): Likewise. * config/pru/pru.c (pru_hard_regno_call_part_clobbered): Likewise. * config/rs6000/rs6000.c (rs6000_hard_regno_call_part_clobbered): Likewise. * config/s390/s390.c (s390_hard_regno_call_part_clobbered): Likewise. * cselib.c: Include function-abi.h. (cselib_process_insn): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * function-abi.cc (predefined_function_abi::initialize): Update call to targetm.hard_regno_call_part_clobbered. * ira-conflicts.c (ira_build_conflicts): Likewise. * ira-costs.c (ira_tune_allocno_costs): Likewise. * lra-constraints.c: Include function-abi.h. (need_for_call_save_p): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * lra-lives.c (check_pseudos_live_through_calls): Likewise. * regcprop.c (copyprop_hardreg_forward_1): Update call to targetm.hard_regno_call_part_clobbered. * reginfo.c (choose_hard_reg_mode): Likewise. * regrename.c (check_new_reg_p): Likewise. * reload.c (find_equiv_reg): Likewise. * reload1.c (emit_reload_insns): Likewise. * sched-deps.c: Include function-abi.h. (deps_analyze_insn): Update call to targetm.hard_regno_call_part_clobbered, using insn_callee_abi to get the appropriate ABI identifier. * sel-sched.c (init_regs_for_mode, mark_unavailable_hard_regs): Update call to targetm.hard_regno_call_part_clobbered. * targhooks.c (default_dwarf_frame_reg_mode): Likewise. From-SVN: r276311
2019-09-03Implement TARGET_HANDLE_GENERIC_ATTRIBUTEJozef Lawrynowicz
gcc/ChangeLog: 2019-09-03 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.c (TARGET_HANDLE_GENERIC_ATTRIBUTE): Define. (msp430_handle_generic_attribute): New function. * doc/tm.texi: Regenerate. * doc/tm.texi.in: Add TARGET_HANDLE_GENERIC_ATTRIBUTE. * hooks.c (hook_tree_treeptr_tree_tree_int_boolptr_null): New. * hooks.h (hook_tree_treeptr_tree_tree_int_boolptr_null): New. * target.def: Define new hook TARGET_HANDLE_GENERIC_ATTRIBUTE. gcc/c-family/ChangeLog: 2019-09-03 Jozef Lawrynowicz <jozef.l@mittosystems.com> * c-attribs.c (handle_section_attribute): Call the handle_generic_attribute target hook after performing target independent processing. (handle_noinit_attribute): Likewise. From-SVN: r275355
2019-01-11aarch64.c (aarch64_simd_call_p): New function.Steve Ellcey
2019-01-11 Steve Ellcey <sellcey@marvell.com> * config/aarch64/aarch64.c (aarch64_simd_call_p): New function. (aarch64_hard_regno_call_part_clobbered): Add insn argument. (aarch64_return_call_with_max_clobbers): New function. (TARGET_RETURN_CALL_WITH_MAX_CLOBBERS): New macro. * config/avr/avr.c (avr_hard_regno_call_part_clobbered): Add insn argument. * config/i386/i386.c (ix86_hard_regno_call_part_clobbered): Ditto. * config/mips/mips.c (mips_hard_regno_call_part_clobbered): Ditto. * config/rs6000/rs6000.c (rs6000_hard_regno_call_part_clobbered): Ditto. * config/s390/s390.c (s390_hard_regno_call_part_clobbered): Ditto. * cselib.c (cselib_process_insn): Add argument to targetm.hard_regno_call_part_clobbered call. * ira-conflicts.c (ira_build_conflicts): Ditto. * ira-costs.c (ira_tune_allocno_costs): Ditto. * lra-constraints.c (inherit_reload_reg): Ditto. * lra-int.h (struct lra_reg): Add call_insn field, remove call_p field. * lra-lives.c (check_pseudos_live_through_calls): Add call_insn argument. Call targetm.return_call_with_max_clobbers. Add argument to targetm.hard_regno_call_part_clobbered call. (calls_have_same_clobbers_p): New function. (process_bb_lives): Add call_insn and last_call_insn variables. Pass call_insn to check_pseudos_live_through_calls. Modify if stmt to check targetm.return_call_with_max_clobbers. Update setting of flush variable. (lra_create_live_ranges_1): Set call_insn to NULL instead of call_p to false. * lra.c (initialize_lra_reg_info_element): Set call_insn to NULL. * regcprop.c (copyprop_hardreg_forward_1): Add argument to targetm.hard_regno_call_part_clobbered call. * reginfo.c (choose_hard_reg_mode): Ditto. * regrename.c (check_new_reg_p): Ditto. * reload.c (find_equiv_reg): Ditto. * reload1.c (emit_reload_insns): Ditto. * sched-deps.c (deps_analyze_insn): Ditto. * sel-sched.c (init_regs_for_mode): Ditto. (mark_unavailable_hard_regs): Ditto. * targhooks.c (default_dwarf_frame_reg_mode): Ditto. * target.def (hard_regno_call_part_clobbered): Add insn argument. (return_call_with_max_clobbers): New target function. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_RETURN_CALL_WITH_MAX_CLOBBERS): New hook. * hooks.c (hook_bool_uint_mode_false): Change to hook_bool_insn_uint_mode_false. * hooks.h (hook_bool_uint_mode_false): Ditto. From-SVN: r267848
2019-01-01Update copyright years.Jakub Jelinek
From-SVN: r267494
2018-12-14[PATCH 1/3][GCC] Add new target hook asm_post_cfi_startprocSam Tebbs
2018-12-14 Sam Tebbs <sam.tebbs@arm.com> * doc/tm.texi (TARGET_ASM_POST_CFI_STARTPROC): Define. * doc/tm.texi.in (TARGET_ASM_POST_CFI_STARTPROC): Define. * dwarf2out.c (dwarf2out_do_cfi_startproc): Trigger the hook. * hooks.c (hook_void_FILEptr_tree): Define. * hooks.h (hook_void_FILEptr_tree): Define. * target.def (post_cfi_startproc): Define. From-SVN: r267135
2018-02-13common.opt (gas-loc-support, [...]): New.Alexandre Oliva
* common.opt (gas-loc-support, gas-locview-support): New. (ginline-points, ginternal-reset-location-views): New. * doc/invoke.texi: Document them. Use @itemx where intended. (gvariable-location-views): Adjust. * target.def (reset_location_view): New. * doc/tm.texi.in (DWARF2_ASM_VIEW_DEBUG_INFO): New. (TARGET_RESET_LOCATION_VIEW): New. * doc/tm.texi: Rebuilt. * dwarf2out.c (dwarf2out_default_as_loc_support): New. (dwarf2out_default_as_locview_support): New. (output_asm_line_debug_info): Use option variables. (dwarf2out_maybe_output_loclist_view_pair): Likewise. (output_loc_list): Likewise. (add_high_low_attributes): Check option variables. Don't output entry view attribute in strict mode. (gen_inlined_subroutine_die): Check option variables. (dwarf2out_inline_entry): Likewise. (init_sections_and_labels): Likewise. (dwarf2out_early_finish): Likewise. (maybe_reset_location_view): New, from... (dwarf2out_var_location): ... here. Call it. * debug.h (dwarf2out_default_as_loc_support): Declare. (dwarf2out_default_as_locview_support): Declare. * hooks.c (hook_int_rtx_insn_0): New. * hooks.h (hook_int_rtx_insn_0): Declare. * toplev.c (process_options): Take -gas-loc-support and -gas-locview-support from dwarf2out. Enable -gvariable-location-views by default only with locview assembler support. Enable -ginternal-reset-location-views by default only if the target defines the corresponding hook. Enable -ginline-points by default if location views are enabled; force it disabled if statement frontiers are disabled. * tree-inline.c (expand_call_inline): Check option variables. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. From-SVN: r257631
2018-01-13Give the target more control over ARRAY_TYPE modesRichard Sandiford
So far we've used integer modes for LD[234] and ST[234] arrays. That doesn't scale well to SVE, since the sizes aren't fixed at compile time (and even if they were, we wouldn't want integers to be so wide). This patch lets the target use double-, triple- and quadruple-length vectors instead. 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (array_mode): New target hook. * doc/tm.texi.in (TARGET_ARRAY_MODE): New hook. * doc/tm.texi: Regenerate. * hooks.h (hook_optmode_mode_uhwi_none): Declare. * hooks.c (hook_optmode_mode_uhwi_none): New function. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Use targetm.array_mode. * stor-layout.c (mode_for_array): Likewise. Support polynomial type sizes. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256617
2018-01-03Update copyright years.Jakub Jelinek
From-SVN: r256169
2017-12-20poly_int: TRULY_NOOP_TRUNCATIONRichard Sandiford
This patch makes TRULY_NOOP_TRUNCATION take the mode sizes as poly_uint64s instead of unsigned ints. The function bodies don't need to change. 2017-12-20 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (truly_noop_truncation): Take poly_uint64s instead of unsigned ints. Change default to hook_bool_puint64_puint64_true. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_uint_uint_true): Delete. (hook_bool_puint64_puint64_true): Declare. * hooks.c (hook_bool_uint_uint_true): Delete. (hook_bool_puint64_puint64_true): New function. * config/mips/mips.c (mips_truly_noop_truncation): Take poly_uint64s instead of unsigned ints. * config/spu/spu.c (spu_truly_noop_truncation): Likewise. * config/tilegx/tilegx.c (tilegx_truly_noop_truncation): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255866
2017-10-23Convert STARTING_FRAME_OFFSET to a hookRichard Sandiford
I took the documentation of the FRAME_GROWS_DOWNWARD behaviour from the version that was in most header files, since the one in the manual seemed less clear. The patch deliberately keeps FIRST_PARM_OFFSET(FNDECL) in microblaze_starting_frame_offset; this seems to be a port-local convention and takes advantage of the fact that FIRST_PARM_OFFSET doesn't read FNDECL. 2017-10-23 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * target.def (starting_frame_offset): New hook. * doc/tm.texi (STARTING_FRAME_OFFSET): Remove in favor of... (TARGET_STARTING_FRAME_OFFSET): ...this new hook. * doc/tm.texi.in: Regenerate. * hooks.h (hook_hwi_void_0): Declare. * hooks.c (hook_hwi_void_0): New function. * doc/rtl.texi: Refer to TARGET_STARTING_FRAME_OFFSET instead of STARTING_FRAME_OFFSET. * builtins.c (expand_builtin_setjmp_receiver): Likewise. * reload1.c (reload): Likewise. * cfgexpand.c (expand_used_vars): Use targetm.starting_frame_offset instead of STARTING_FRAME_OFFSET. * function.c (try_fit_stack_local): Likewise. (assign_stack_local_1): Likewise (instantiate_virtual_regs): Likewise. * rtlanal.c (rtx_addr_can_trap_p_1): Likewise. * config/avr/avr.md (nonlocal_goto_receiver): Likewise. * config/aarch64/aarch64.h (STARTING_FRAME_OFFSET): Delete. * config/alpha/alpha.h (STARTING_FRAME_OFFSET): Likewise. * config/arc/arc.h (STARTING_FRAME_OFFSET): Likewise. * config/arm/arm.h (STARTING_FRAME_OFFSET): Likewise. * config/bfin/bfin.h (STARTING_FRAME_OFFSET): Likewise. * config/c6x/c6x.h (STARTING_FRAME_OFFSET): Likewise. * config/cr16/cr16.h (STARTING_FRAME_OFFSET): Likewise. * config/cris/cris.h (STARTING_FRAME_OFFSET): Likewise. * config/fr30/fr30.h (STARTING_FRAME_OFFSET): Likewise. * config/frv/frv.h (STARTING_FRAME_OFFSET): Likewise. * config/ft32/ft32.h (STARTING_FRAME_OFFSET): Likewise. * config/h8300/h8300.h (STARTING_FRAME_OFFSET): Likewise. * config/i386/i386.h (STARTING_FRAME_OFFSET): Likewise. * config/ia64/ia64.h (STARTING_FRAME_OFFSET): Likewise. * config/m32c/m32c.h (STARTING_FRAME_OFFSET): Likewise. * config/m68k/m68k.h (STARTING_FRAME_OFFSET): Likewise. * config/mcore/mcore.h (STARTING_FRAME_OFFSET): Likewise. * config/mn10300/mn10300.h (STARTING_FRAME_OFFSET): Likewise. * config/moxie/moxie.h (STARTING_FRAME_OFFSET): Likewise. * config/msp430/msp430.h (STARTING_FRAME_OFFSET): Likewise. * config/nds32/nds32.h (STARTING_FRAME_OFFSET): Likewise. * config/nios2/nios2.h (STARTING_FRAME_OFFSET): Likewise. * config/nvptx/nvptx.h (STARTING_FRAME_OFFSET): Likewise. * config/pdp11/pdp11.h (STARTING_FRAME_OFFSET): Likewise. * config/riscv/riscv.h (STARTING_FRAME_OFFSET): Likewise. * config/rl78/rl78.h (STARTING_FRAME_OFFSET): Likewise. * config/rx/rx.h (STARTING_FRAME_OFFSET): Likewise. * config/s390/s390.h (STARTING_FRAME_OFFSET): Likewise. * config/sh/sh.h (STARTING_FRAME_OFFSET): Likewise. * config/sparc/sparc.c (sparc_compute_frame_size): Likewise. * config/sparc/sparc.h (STARTING_FRAME_OFFSET): Likewise. * config/spu/spu.h (STARTING_FRAME_OFFSET): Likewise. * config/stormy16/stormy16.h (STARTING_FRAME_OFFSET): Likewise. * config/tilegx/tilegx.h (STARTING_FRAME_OFFSET): Likewise. * config/tilepro/tilepro.h (STARTING_FRAME_OFFSET): Likewise. * config/v850/v850.h (STARTING_FRAME_OFFSET): Likewise. * config/visium/visium.h (STARTING_FRAME_OFFSET): Likewise. * config/avr/avr.h (STARTING_FRAME_OFFSET): Likewise. * config/avr/avr-protos.h (avr_starting_frame_offset): Likewise. * config/avr/avr.c (avr_starting_frame_offset): Make static and return a HOST_WIDE_INT. (avr_builtin_setjmp_frame_value): Use it instead of STARTING_FRAME_OFFSET. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/epiphany/epiphany.h (STARTING_FRAME_OFFSET): Delete. * config/epiphany/epiphany.c (epiphany_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/iq2000/iq2000.h (STARTING_FRAME_OFFSET): Delete. * config/iq2000/iq2000.c (iq2000_starting_frame_offset): New function. (TARGET_CONSTANT_ALIGNMENT): Redefine. * config/lm32/lm32.h (STARTING_FRAME_OFFSET): Delete. * config/lm32/lm32.c (lm32_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/m32r/m32r.h (STARTING_FRAME_OFFSET): Delete. * config/m32r/m32r.c (m32r_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/microblaze/microblaze.h (STARTING_FRAME_OFFSET): Delete. * config/microblaze/microblaze.c (microblaze_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/mips/mips.h (STARTING_FRAME_OFFSET): Delete. * config/mips/mips.c (mips_compute_frame_info): Refer to TARGET_STARTING_FRAME_OFFSET instead of STARTING_FRAME_OFFSET. (mips_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/mmix/mmix.h (STARTING_FRAME_OFFSET): Delete. * config/mmix/mmix-protos.h (mmix_starting_frame_offset): Delete. * config/mmix/mmix.c (mmix_starting_frame_offset): Make static and return a HOST_WIDE_INT. (TARGET_STARTING_FRAME_OFFSET): Redefine. (mmix_initial_elimination_offset): Refer to TARGET_STARTING_FRAME_OFFSET instead of STARTING_FRAME_OFFSET. * config/pa/pa.h (STARTING_FRAME_OFFSET): Delete. * config/pa/pa.c (pa_starting_frame_offset): New function. (pa_compute_frame_size): Use it instead of STARTING_FRAME_OFFSET. (pa_expand_prologue): Likewise. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/powerpcspe/aix.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/powerpcspe/darwin.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/powerpcspe/powerpcspe.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/powerpcspe/powerpcspe.c (TARGET_STARTING_FRAME_OFFSET): Redefine. (rs6000_starting_frame_offset): New function. * config/rs6000/aix.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/rs6000/darwin.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/rs6000/rs6000.h (STARTING_FRAME_OFFSET): Split out !FRAME_GROWS_DOWNWARD handling to... (RS6000_STARTING_FRAME_OFFSET): ...this new macro. * config/rs6000/rs6000.c (TARGET_STARTING_FRAME_OFFSET): Refine. (rs6000_starting_frame_offset): New function. * config/vax/elf.h (STARTING_FRAME_OFFSET): Delete. * config/vax/vax.h (STARTING_FRAME_OFFSET): Delete. * config/vax/vax.c (vax_starting_frame_offset): New function. (vax_expand_prologue): Use it instead of STARTING_FRAME_OFFSET. (TARGET_STARTING_FRAME_OFFSET): Redefine. * config/xtensa/xtensa.h (STARTING_FRAME_OFFSET): Delete. * config/xtensa/xtensa.c (xtensa_starting_frame_offset): New function. (TARGET_STARTING_FRAME_OFFSET): Redefine. * system.h (STARTING_FRAME_OFFSET): Poison. From-SVN: r254003
2017-09-15Turn TRULY_NOOP_TRUNCATION into a hookRichard Sandiford
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
2017-09-15Turn CANNOT_CHANGE_MODE_CLASS into a hookRichard Sandiford
This also seemed like a good opportunity to reverse the sense of the hook to "can", to avoid the awkward double negative in !CANNOT. 2017-09-15 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayard <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (can_change_mode_class): New hook. (mode_rep_extended): Refer to it instead of CANNOT_CHANGE_MODE_CLASS. (hard_regno_nregs): Likewise. * hooks.h (hook_bool_mode_mode_reg_class_t_true): Declare. * hooks.c (hook_bool_mode_mode_reg_class_t_true): New function. * doc/tm.texi.in (CANNOT_CHANGE_MODE_CLASS): Replace with... (TARGET_CAN_CHANGE_MODE_CLASS): ...this. (LOAD_EXTEND_OP): Update accordingly. * doc/tm.texi: Regenerate. * doc/rtl.texi: Refer to TARGET_CAN_CHANGE_MODE_CLASS instead of CANNOT_CHANGE_MODE_CLASS. * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): Replace with... (REG_CAN_CHANGE_MODE_P): ...this new macro. * combine.c (simplify_set): Update accordingly. * emit-rtl.c (validate_subreg): Likewise. * recog.c (general_operand): Likewise. * regcprop.c (mode_change_ok): Likewise. * reload1.c (choose_reload_regs): Likewise. (inherit_piecemeal_p): Likewise. * rtlanal.c (simplify_subreg_regno): Likewise. * postreload.c (reload_cse_simplify_set): Use REG_CAN_CHANGE_MODE_P instead of CANNOT_CHANGE_MODE_CLASS. (reload_cse_simplify_operands): Likewise. * reload.c (push_reload): Use targetm.can_change_mode_class instead of CANNOT_CHANGE_MODE_CLASS. (push_reload): Likewise. Also use REG_CAN_CHANGE_MODE_P instead of REG_CANNOT_CHANGE_MODE_P. * config/alpha/alpha.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/alpha/alpha.c (alpha_can_change_mode_class): New function. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/arm/arm.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (arm_can_change_mode_class): New function. * config/arm/neon.md: Refer to TARGET_CAN_CHANGE_MODE_CLASS rather than CANNOT_CHANGE_MODE_CLASS in comments. * config/i386/i386.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/i386/i386-protos.h (ix86_cannot_change_mode_class): Delete. * config/i386/i386.c (ix86_cannot_change_mode_class): Replace with... (ix86_can_change_mode_class): ...this new function, inverting the sense of the return value. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/ia64/ia64.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/ia64/ia64.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (ia64_can_change_mode_class): New function. * config/m32c/m32c.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/m32c/m32c-protos.h (m32c_cannot_change_mode_class): Delete. * config/m32c/m32c.c (m32c_cannot_change_mode_class): Replace with... (m32c_can_change_mode_class): ...this new function, inverting the sense of the return value. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/mips/mips.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Delete. * config/mips/mips.c (mips_cannot_change_mode_class): Replace with... (mips_can_change_mode_class): ...this new function, inverting the sense of the return value. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/msp430/msp430.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/msp430/msp430.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (msp430_can_change_mode_class): New function. * config/nvptx/nvptx.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/nvptx/nvptx.c (nvptx_can_change_mode_class): New function. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/pa/pa32-regs.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/pa/pa64-regs.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/pa/pa-protos.h (pa_cannot_change_mode_class): Delete. * config/pa/pa.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (pa_cannot_change_mode_class): Replace with... (pa_can_change_mode_class): ...this new function, inverting the sense of the return value. (pa_modes_tieable_p): Refer to TARGET_CAN_CHANGE_MODE_CLASS rather than CANNOT_CHANGE_MODE_CLASS in comments. * config/pdp11/pdp11.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/pdp11/pdp11-protos.h (pdp11_cannot_change_mode_class): Delete. * config/pdp11/pdp11.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (pdp11_cannot_change_mode_class): Replace with... (pdp11_can_change_mode_class): ...this new function, inverting the sense of the return value. * config/powerpcspe/powerpcspe.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/powerpcspe/powerpcspe-protos.h (rs6000_cannot_change_mode_class_ptr): Delete. * config/powerpcspe/powerpcspe.c (rs6000_cannot_change_mode_class_ptr): Delete. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (rs6000_option_override_internal): Assign to targetm.can_change_mode_class instead of rs6000_cannot_change_mode_class_ptr. (rs6000_cannot_change_mode_class): Replace with... (rs6000_can_change_mode_class): ...this new function, inverting the sense of the return value. (rs6000_debug_cannot_change_mode_class): Replace with... (rs6000_debug_can_change_mode_class): ...this new function. * config/riscv/riscv.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/riscv/riscv.c (riscv_can_change_mode_class): New function. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/rs6000/rs6000-protos.h (rs6000_cannot_change_mode_class_ptr): Delete. * config/rs6000/rs6000.c (rs6000_cannot_change_mode_class_ptr): Delete. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (rs6000_option_override_internal): Assign to targetm.can_change_mode_class instead of rs6000_cannot_change_mode_class_ptr. (rs6000_cannot_change_mode_class): Replace with... (rs6000_can_change_mode_class): ...this new function, inverting the sense of the return value. (rs6000_debug_cannot_change_mode_class): Replace with... (rs6000_debug_can_change_mode_class): ...this new function. * config/s390/s390.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/s390/s390-protos.h (s390_cannot_change_mode_class): Delete. * config/s390/s390.c (s390_cannot_change_mode_class): Replace with... (s390_can_change_mode_class): ...this new function, inverting the sense of the return value. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/sh/sh.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Delete. * config/sh/sh.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (sh_cannot_change_mode_class): Replace with... (sh_can_change_mode_class): ...this new function, inverting the sense of the return value. * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/sparc/sparc.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (sparc_can_change_mode_class): New function. * config/spu/spu.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/spu/spu.c (spu_can_change_mode_class): New function. (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. * config/visium/visium.h (CANNOT_CHANGE_MODE_CLASS): Delete. * config/visium/visium.c (TARGET_CAN_CHANGE_MODE_CLASS): Redefine. (visium_can_change_mode_class): New function. * system.h (CANNOT_CHANGE_MODE_CLASS): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r252816
2017-09-13Turn SECONDARY_MEMORY_NEEDED into a hookRichard Sandiford
Since the patch is going through all the definitions anyway, it seemed like a good opportunity to put the mode argument first, to match the order for register_move_cost. 2017-09-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (secondary_memory_needed): New hook. (secondary_reload): Refer to TARGET_SECONDARY_MEMORY_NEEDED instead of SECONDARY_MEMORY_NEEDED. (secondary_memory_needed_mode): Likewise. * hooks.h (hook_bool_mode_reg_class_t_reg_class_t_false): Declare. * hooks.c (hook_bool_mode_reg_class_t_reg_class_t_false): New function. * doc/tm.texi.in (SECONDARY_MEMORY_NEEDED): Replace with... (TARGET_SECONDARY_MEMORY_NEEDED): ...this. (SECONDARY_MEMORY_NEEDED_RTX): Update reference accordingly. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (SECONDARY_MEMORY_NEEDED): Delete. * config/alpha/alpha.c (alpha_secondary_memory_needed): New function. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. * config/i386/i386.h (SECONDARY_MEMORY_NEEDED): Delete. * config/i386/i386-protos.h (ix86_secondary_memory_needed): Delete. * config/i386/i386.c (inline_secondary_memory_needed): Put the mode argument first and change the reg_class arguments to reg_class_t. (ix86_secondary_memory_needed): Likewise. Remove the strict parameter. Make static. Update the call to inline_secondary_memory_needed. (ix86_register_move_cost): Update the call to inline_secondary_memory_needed. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. * config/ia64/ia64.h (SECONDARY_MEMORY_NEEDED): Delete commented-out definition. * config/ia64/ia64.c (spill_xfmode_rfmode_operand): Refer to TARGET_SECONDARY_MEMORY_NEEDED rather than SECONDARY_MEMORY_NEEDED in comment. * config/mips/mips.h (SECONDARY_MEMORY_NEEDED): Delete. * config/mips/mips-protos.h (mips_secondary_memory_needed): Delete. * config/mips/mips.c (mips_secondary_memory_needed): Make static and match hook interface. Add comment from mips.h. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. * config/mmix/mmix.md (truncdfsf2): Refer to TARGET_SECONDARY_MEMORY_NEEDED rather than SECONDARY_MEMORY_NEEDED in comment. * config/pa/pa-64.h (SECONDARY_MEMORY_NEEDED): Rename to... (PA_SECONDARY_MEMORY_NEEDED): ...this, and put the mode argument first. * config/pa/pa.c (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. (pa_secondary_memory_needed): New function. * config/pdp11/pdp11.h (SECONDARY_MEMORY_NEEDED): Delete. * config/pdp11/pdp11-protos.h (pdp11_secondary_memory_needed): Delete. * config/pdp11/pdp11.c (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. (pdp11_secondary_memory_needed): Make static and match hook interface. * config/powerpcspe/powerpcspe.h (SECONDARY_MEMORY_NEEDED): Delete. * config/powerpcspe/powerpcspe-protos.h (rs6000_secondary_memory_needed_ptr): Delete. * config/powerpcspe/powerpcspe.c (rs6000_secondary_memory_needed_ptr): Delete. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. (rs6000_option_override_internal): Assign to targetm.secondary_memory_needed rather than rs6000_secondary_memory_needed_ptr. (rs6000_secondary_memory_needed): Match hook interface. (rs6000_debug_secondary_memory_needed): Likewise. * config/riscv/riscv.h (SECONDARY_MEMORY_NEEDED): Delete. * config/riscv/riscv.c (riscv_secondary_memory_needed): New function. (riscv_register_move_cost): Use it instead of SECONDARY_MEMORY_NEEDED. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. * config/rs6000/rs6000.h (SECONDARY_MEMORY_NEEDED): Delete. * config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_ptr): Delete. * config/rs6000/rs6000.c (rs6000_secondary_memory_needed_ptr): Delete. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. (rs6000_option_override_internal): Assign to targetm.secondary_memory_needed rather than rs6000_secondary_memory_needed_ptr. (rs6000_secondary_memory_needed): Match hook interface. (rs6000_debug_secondary_memory_needed): Likewise. * config/s390/s390.h (SECONDARY_MEMORY_NEEDED): Delete. * config/s390/s390.c (s390_secondary_memory_needed): New function. (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. * config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED): Delete. * config/sparc/sparc.c (TARGET_SECONDARY_MEMORY_NEEDED): Redefine. (sparc_secondary_memory_needed): New function. * lra-constraints.c (check_and_process_move): Refer to TARGET_SECONDARY_MEMORY_NEEDED rather than SECONDARY_MEMORY_NEEDED in comment. (curr_insn_transform): Likewise. (process_alt_operands): Use targetm.secondary_memory_needed instead of TARGET_SECONDARY_MEMORY_NEEDED. (check_secondary_memory_needed_p): Likewise. (choose_split_class): Likewise. * reload.c: Unconditionally include code that was previously conditional on SECONDARY_MEMORY_NEEDED. (push_secondary_reload): Use targetm.secondary_memory_needed instead of TARGET_SECONDARY_MEMORY_NEEDED. (push_reload): Likewise. * reload1.c: Unconditionally include code that was previously conditional on SECONDARY_MEMORY_NEEDED. (choose_reload_regs): Use targetm.secondary_memory_needed instead of TARGET_SECONDARY_MEMORY_NEEDED. (gen_reload): Likewise. * system.h (SECONDARY_MEMORY_NEEDED): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r252461
2017-09-04Turn MODES_TIEABLE_P into a target hookRichard Sandiford
2017-09-04 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (modes_tieable_p): New hook. * doc/tm.texi (MODES_TIEABLE_P): Replace with... (TARGET_MODES_TIEABLE_P): ...this. * doc/tm.texi.in: Regenerate. * hooks.h (hook_bool_mode_mode_true): Declare. * hooks.c (hook_bool_mode_mode_true): New function. * combine.c (subst): Use targetm.modes_tieable_p instead of MODES_TIEABLE_P. * dse.c (find_shift_sequence): Likewise. * expmed.c (extract_low_bits): Likewise. * lower-subreg.c: Include target.h. (find_decomposable_subregs): Use targetm.modes_tieable_p instead of MODES_TIEABLE_P. * rtlanal.c (rtx_cost): Likewise. * config/aarch64/aarch64.h (MODES_TIEABLE_P): Delete. * config/aarch64/aarch64-protos.h (aarch64_modes_tieable_p): Delete. * config/aarch64/aarch64.c (aarch64_modes_tieable_p): Make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/alpha/alpha.h (MODES_TIEABLE_P): Delete. * config/alpha/alpha.c (alpha_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/arc/arc.h (MODES_TIEABLE_P): Delete. * config/arc/arc.c (TARGET_MODES_TIEABLE_P): Redefine. (arc_modes_tieable_p): New function. * config/arm/arm.h (MODES_TIEABLE_P): Delete. * config/arm/arm-protos.h (arm_modes_tieable_p): Delete. * config/arm/arm.c (TARGET_MODES_TIEABLE_P): Redefine. (arm_modes_tieable_p): Make static. * config/avr/avr.h (MODES_TIEABLE_P): Delete. * config/bfin/bfin.h (MODES_TIEABLE_P): Delete. * config/bfin/bfin.c (bfin_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/c6x/c6x.h (MODES_TIEABLE_P): Delete. * config/c6x/c6x.c (c6x_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/cr16/cr16.h (MODES_TIEABLE_P): Delete. * config/cr16/cr16.c (TARGET_MODES_TIEABLE_P): Redefine. (cr16_modes_tieable_p): New function. * config/cris/cris.h (MODES_TIEABLE_P): Delete. * config/epiphany/epiphany.h (MODES_TIEABLE_P): Delete. * config/fr30/fr30.h (MODES_TIEABLE_P): Delete. (TRULY_NOOP_TRUNCATION): Update comment. * config/frv/frv.h (MODES_TIEABLE_P): Delete. (TRULY_NOOP_TRUNCATION): Update comment. * config/frv/frv.c (TARGET_MODES_TIEABLE_P): Redefine. (frv_modes_tieable_p): New function. * config/ft32/ft32.h (MODES_TIEABLE_P): Delete. * config/h8300/h8300.h (MODES_TIEABLE_P): Delete. * config/h8300/h8300.c (h8300_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/i386/i386.h (MODES_TIEABLE_P): Delete. * config/i386/i386-protos.h (ix86_modes_tieable_p): Delete. * config/i386/i386.c (ix86_modes_tieable_p): Make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/ia64/ia64.h (MODES_TIEABLE_P): Delete. * config/ia64/ia64.c (TARGET_MODES_TIEABLE_P): Redefine. (ia64_modes_tieable_p): New function. * config/iq2000/iq2000.h (MODES_TIEABLE_P): Delete. * config/iq2000/iq2000.c (TARGET_MODES_TIEABLE_P): Redefine. (iq2000_modes_tieable_p): New function. * config/lm32/lm32.h (MODES_TIEABLE_P): Delete. * config/lm32/lm32.c (TARGET_MODES_TIEABLE_P): Redefine. (lm32_modes_tieable_p): New function. * config/m32c/m32c.h (MODES_TIEABLE_P): Delete. * config/m32c/m32c-protos.h (m32c_modes_tieable_p): Delete. * config/m32c/m32c.c (m32c_modes_tieable_p): Make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/m32r/m32r.h (MODES_TIEABLE_P): Delete. * config/m32r/m32r.c (TARGET_MODES_TIEABLE_P): Redefine. (m32r_modes_tieable_p): New function. * config/m68k/m68k.h (MODES_TIEABLE_P): Delete. * config/m68k/m68k.c (TARGET_MODES_TIEABLE_P): Redefine. (m68k_modes_tieable_p): New function. * config/mcore/mcore.h (MODES_TIEABLE_P): Delete. * config/mcore/mcore.c (TARGET_MODES_TIEABLE_P): Redefine. (mcore_modes_tieable_p): New function. * config/microblaze/microblaze.h (MODES_TIEABLE_P): Delete. * config/microblaze/microblaze.c (microblaze_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/mips/mips.h (MODES_TIEABLE_P): Delete. * config/mips/mips-protos.h (mips_modes_tieable_p): Delete. * config/mips/mips.c (mips_modes_tieable_p): Make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/mmix/mmix.h (MODES_TIEABLE_P): Delete. * config/mn10300/mn10300.h (MODES_TIEABLE_P): Delete. * config/mn10300/mn10300-protos.h (mn10300_modes_tieable): Delete. * config/mn10300/mn10300.c (mn10300_modes_tieable): Rename to... (mn10300_modes_tieable_p): ...this and make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/moxie/moxie.h (MODES_TIEABLE_P): Delete. * config/msp430/msp430.h (MODES_TIEABLE_P): Delete. * config/msp430/msp430-protos.h (msp430_modes_tieable_p): Delete. * config/msp430/msp430.c (TARGET_MODES_TIEABLE_P): Redefine. (msp430_modes_tieable_p): Make static. * config/nds32/nds32.h (MODES_TIEABLE_P): Delete. * config/nds32/nds32.c (nds32_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/nios2/nios2.h (MODES_TIEABLE_P): Delete. * config/nvptx/nvptx.h (MODES_TIEABLE_P): Delete. * config/nvptx/nvptx.c (nvptx_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/pa/pa.h (MODES_TIEABLE_P): Delete. * config/pa/pa-protos.h (pa_modes_tieable_p): Delete. * config/pa/pa.c (pa_modes_tieable_p): Make static. (TARGET_MODES_TIEABLE_P): Redefine. * config/pdp11/pdp11.h (MODES_TIEABLE_P): Delete. * config/pdp11/pdp11.c (TARGET_MODES_TIEABLE_P): Redefine. (pdp11_modes_tieable_p): New function. * config/powerpcspe/powerpcspe.h (MODES_TIEABLE_P): Delete. * config/powerpcspe/powerpcspe.c (TARGET_MODES_TIEABLE_P): Redefine. (rs6000_modes_tieable_p): New function. (rs6000_debug_reg_global): Use it instead of MODES_TIEABLE_P. * config/powerpcspe/powerpcspe.md: Update comment. * config/riscv/riscv.h (MODES_TIEABLE_P): Delete. * config/riscv/riscv.c (riscv_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/rl78/rl78.h (MODES_TIEABLE_P): Delete. * config/rl78/rl78.c (TARGET_MODES_TIEABLE_P): Redefine. (rl78_modes_tieable_p): New function. * config/rs6000/rs6000.h (MODES_TIEABLE_P): Delete. * config/rs6000/rs6000.c (TARGET_MODES_TIEABLE_P): Redefine. (rs6000_modes_tieable_p): New function. (rs6000_debug_reg_global): Use it instead of MODES_TIEABLE_P. * config/rs6000/rs6000.md: Update comment. * config/rx/rx.h (MODES_TIEABLE_P): Delete. * config/rx/rx.c (rx_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/s390/s390.h (MODES_TIEABLE_P): Delete. * config/s390/s390.c (s390_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/sh/sh.h (MODES_TIEABLE_P): Delete. * config/sh/sh.c (TARGET_MODES_TIEABLE_P): Redefine. (sh_modes_tieable_p): New function. * config/sparc/sparc.h (MODES_TIEABLE_P): Delete. * config/sparc/sparc-protos.h (sparc_modes_tieable_p): Delete. * config/sparc/sparc.c (TARGET_MODES_TIEABLE_P): Redefine. (sparc_modes_tieable_p): Make static. * config/spu/spu.h (MODES_TIEABLE_P): Delete. * config/spu/spu.c (spu_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/stormy16/stormy16.h (MODES_TIEABLE_P): Delete. * config/stormy16/stormy16.c (xstormy16_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/tilegx/tilegx.h (MODES_TIEABLE_P): Delete. * config/tilepro/tilepro.h (MODES_TIEABLE_P): Delete. * config/v850/v850.h (MODES_TIEABLE_P): Delete. * config/v850/v850.c (v850_modes_tieable_p): New function. (TARGET_MODES_TIEABLE_P): Redefine. * config/vax/vax.h (MODES_TIEABLE_P): Delete. * config/visium/visium.h (MODES_TIEABLE_P): Delete. * config/visium/visium.c (TARGET_MODES_TIEABLE_P): Redefine. (visium_modes_tieable_p): New function. * config/xtensa/xtensa.h (MODES_TIEABLE_P): Delete. * config/xtensa/xtensa.c (TARGET_MODES_TIEABLE_P): Redefine. (xtensa_modes_tieable_p): New function. * system.h (MODES_TIEABLE_P): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251647
2017-09-04Turn HARD_REGNO_MODE_OK into a target hookRichard Sandiford
2017-09-04 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (hard_regno_mode_ok): New hook. * doc/tm.texi (HARD_REGNO_MODE_OK): Replace with... (TARGET_HARD_REGNO_MODE_OK): ...this. * doc/tm.texi.in: Regenerate. * hooks.h (hook_bool_uint_mode_true): Declare. * hooks.c (hook_bool_uint_mode_true): New function. * doc/md.texi: Refer to targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * genpreds.c (write_insn_preds_c): Add an include of target.h. * alias.c (init_alias_target): Use targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * caller-save.c: Include target.h. (reg_save_code): Use targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * combine.c (can_combine_p): Likewise. (combinable_i3pat): Likewise. (can_change_dest_mode): Likewise. * expr.c (init_expr_target): Likewise. (convert_move): Likewise. (convert_modes): Likewise. * ira.c (setup_prohibited_class_mode_regs): Likewise. (setup_prohibited_mode_move_regs): Likewise. * ira.h (target_ira): Likewise. * lra-assigns.c (find_hard_regno_for_1): Likewise. * lra-constraints.c (process_alt_operands): Likewise. (split_reg): Likewise. * recog.c (peep2_find_free_register): Likewise. * ree.c (combine_reaching_defs): Likewise. * regcprop.c (maybe_mode_change): Likewise. * reginfo.c (init_reg_sets_1): Likewise. (choose_hard_reg_mode): Likewise. (simplifiable_subregs): Likewise. * regrename.c (check_new_reg_p): Likewise. * reload.c (find_valid_class): Likewise. (find_valid_class_1): Likewise. (reload_inner_reg_of_subreg): Likewise. (push_reload): Likewise. (combine_reloads): Likewise. (find_dummy_reload): Likewise. (find_reloads): Likewise. * reload1.c (find_reg): Likewise. (set_reload_reg): Likewise. (allocate_reload_reg): Likewise. (choose_reload_regs): Likewise. (reload_adjust_reg_for_temp): Likewise. * rtlanal.c (subreg_size_offset_from_lsb): Likewise. (simplify_subreg_regno): Likewise. * sel-sched.c (init_regs_for_mode): Likewise. * varasm.c (make_decl_rtl): Likewise. * config/aarch64/aarch64.h (HARD_REGNO_MODE_OK): Delete. (MODES_TIEABLE_P): Use targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/aarch64/aarch64-protos.h (aarch64_hard_regno_mode_ok): Delete. * config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/alpha/alpha.h (HARD_REGNO_MODE_OK): Delete. * config/alpha/alpha.c (alpha_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/arc/arc.h (arc_hard_regno_mode_ok): Delete. (arc_mode_class): Delete. (HARD_REGNO_MODE_OK): Delete. * config/arc/arc.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (arc_hard_regno_mode_ok): Rename old array to... (arc_hard_regno_mode_ok_modes): ...this. (arc_conditional_register_usage): Update accordingly. (arc_mode_class): Make static. (arc_hard_regno_mode_ok): New function. * config/arm/arm.h (HARD_REGNO_MODE_OK): Delete. * config/arm/arm-protos.h (arm_hard_regno_mode_ok): Delete. * config/arm/arm.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (arm_hard_regno_mode_ok): Make static. * config/arm/arm.md (movdi): Use targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/avr/avr-protos.h (avr_hard_regno_mode_ok): Delete. * config/avr/avr.h (HARD_REGNO_MODE_OK): Delete. * config/avr/avr.c (avr_hard_regno_mode_ok): Make static and return a bool. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/bfin/bfin-protos.h (hard_regno_mode_ok): Delete. * config/bfin/bfin.h (HARD_REGNO_MODE_OK): Delete. * config/bfin/bfin.c (hard_regno_mode_ok): Rename to... (bfin_hard_regno_mode_ok): ...this. Make static and return a bool. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/bfin/predicates.md (valid_reg_operand): Use targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/c6x/c6x.h (HARD_REGNO_MODE_OK): Delete. * config/c6x/c6x.c (c6x_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/cr16/cr16.h (HARD_REGNO_MODE_OK): Delete. * config/cr16/cr16-protos.h (cr16_hard_regno_mode_ok): Delete. * config/cr16/cr16.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (cr16_hard_regno_mode_ok): Make static and return a bool. * config/cris/cris.h (HARD_REGNO_MODE_OK): Delete. * config/cris/cris.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (cris_hard_regno_mode_ok): New function. * config/epiphany/epiphany.h (epiphany_hard_regno_mode_ok): Delete. (epiphany_mode_class): Delete. (HARD_REGNO_MODE_OK): Delete. * config/epiphany/epiphany-protos.h (hard_regno_mode_ok): Delete. * config/epiphany/epiphany.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (hard_regno_mode_ok): Rename to... (epiphany_hard_regno_mode_ok): ...this. Make static and return a bool. * config/fr30/fr30.h (HARD_REGNO_MODE_OK): Delete. * config/fr30/fr30.md: Refer to targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/frv/frv.h (HARD_REGNO_MODE_OK): Delete. * config/frv/frv-protos.h (frv_hard_regno_mode_ok): Delete. * config/frv/frv.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (frv_hard_regno_mode_ok): Make static and return a bool. * config/frv/frv.md: Refer to targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/ft32/ft32.h (HARD_REGNO_MODE_OK): Delete. * config/h8300/h8300.h (HARD_REGNO_MODE_OK): Delete. * config/h8300/h8300-protos.h (h8300_hard_regno_mode_ok): Delete. * config/h8300/h8300.c (h8300_hard_regno_mode_ok): Make static and return a bool. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/i386/i386.h (HARD_REGNO_MODE_OK): Delete. * config/i386/i386-protos.h (ix86_hard_regno_mode_ok): Delete. * config/i386/i386.c (ix86_hard_regno_mode_ok): Make static and return a bool. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/ia64/ia64.h (HARD_REGNO_MODE_OK): Delete. * config/ia64/ia64.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (ia64_hard_regno_mode_ok): New function. * config/iq2000/iq2000.h (HARD_REGNO_MODE_OK): Delete. * config/iq2000/iq2000.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (iq2000_hard_regno_mode_ok): New function. * config/lm32/lm32.h (HARD_REGNO_MODE_OK): Delete. * config/lm32/lm32.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (lm32_hard_regno_mode_ok): New function. * config/m32c/m32c.h (HARD_REGNO_MODE_OK): Delete. * config/m32c/m32c-protos.h (m32c_hard_regno_ok): Delete. * config/m32c/m32c.c (class_can_hold_mode): Use m32c_hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. (m32c_hard_regno_ok): Rename to... (m32c_hard_regno_mode_ok): ...this. Make static and return a bool. (m32c_cannot_change_mode_class): Update accordingly. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/m32r/m32r.h (m32r_hard_regno_mode_ok): Delete. (m32r_mode_class): Delete. (HARD_REGNO_MODE_OK): Delete. * config/m32r/m32r.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (m32r_hard_regno_mode_ok): Rename to... (m32r_hard_regno_modes): ...this. (m32r_mode_class): Make static. (m32r_hard_regno_mode_ok): New function. * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Delete. * config/m68k/m68k-protos.h (m68k_regno_mode_ok): Delete. * config/m68k/m68k.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (m68k_hard_regno_mode_ok): Make static. * config/mcore/mcore.h (HARD_REGNO_MODE_OK): Delete. * config/mcore/mcore.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (mcore_hard_regno_mode_ok): New function. * config/microblaze/microblaze.h (microblaze_hard_regno_mode_ok) (HARD_REGNO_MODE_OK): Delete. * config/microblaze/microblaze.c (microblaze_hard_regno_mode_ok): Rename to... (microblaze_hard_regno_mode_ok_p): ...this and make static. (microblaze_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/mips/mips.h (HARD_REGNO_MODE_OK): Delete. (mips_hard_regno_mode_ok): Delete. * config/mips/mips.c (mips_hard_regno_mode_ok): Rename to... (mips_hard_regno_mode_ok_p): ...this and make static. (mips_hard_regno_mode_ok_p): Rename to... (mips_hard_regno_mode_ok_uncached): ...this. (mips_hard_regno_mode_ok): New function. (mips_class_max_nregs): Use mips_hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. (mips_option_override): Update after above name changes. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/mmix/mmix.h (HARD_REGNO_MODE_OK): Delete. * config/mn10300/mn10300.h (HARD_REGNO_MODE_OK): Delete. * config/mn10300/mn10300-protos.h (mn10300_hard_regno_mode_ok): Delete. * config/mn10300/mn10300.c (mn10300_hard_regno_mode_ok): Make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/moxie/moxie.h (HARD_REGNO_MODE_OK): Delete. * config/msp430/msp430.h (HARD_REGNO_MODE_OK): Delete. * config/msp430/msp430-protos.h (msp430_hard_regno_mode_ok): Delete. * config/msp430/msp430.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (msp430_hard_regno_mode_ok): Make static and return a bool. * config/nds32/nds32.h (HARD_REGNO_MODE_OK): Delete. * config/nds32/nds32-protos.h (nds32_hard_regno_mode_ok): Delete. * config/nds32/nds32.c (nds32_hard_regno_mode_ok): Make static and return a bool. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/nios2/nios2.h (HARD_REGNO_MODE_OK): Delete. * config/nvptx/nvptx.h (HARD_REGNO_MODE_OK): Delete. * config/pa/pa.h (MODES_TIEABLE_P): Update commentary. * config/pa/pa32-regs.h (HARD_REGNO_MODE_OK): Rename to... (PA_HARD_REGNO_MODE_OK): ...this * config/pa/pa64-regs.h (HARD_REGNO_MODE_OK): Rename to... (PA_HARD_REGNO_MODE_OK): ...this. * config/pa/pa.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (pa_hard_regno_mode_ok): New function. * config/pdp11/pdp11.h (HARD_REGNO_MODE_OK): Delete. * config/pdp11/pdp11.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (pdp11_hard_regno_mode_ok): New function. * config/powerpcspe/powerpcspe.h (HARD_REGNO_MODE_OK): Delete. * config/powerpcspe/powerpcspe-protos.h (rs6000_hard_regno_mode_ok_p): Delete. * config/powerpcspe/powerpcspe.c (rs6000_hard_regno_mode_ok_p): Make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. (rs6000_hard_regno_mode_ok): Rename to... (rs6000_hard_regno_mode_ok_uncached): ...this. (rs6000_init_hard_regno_mode_ok): Update accordingly. (rs6000_hard_regno_mode_ok): New function. * config/riscv/riscv.h (HARD_REGNO_MODE_OK): Delete. * config/riscv/riscv-protos.h (riscv_hard_regno_mode_ok_p): Delete. * config/riscv/riscv.c (riscv_hard_regno_mode_ok_p): Rename to... (riscv_hard_regno_mode_ok): ...this and make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/rl78/rl78.h (HARD_REGNO_MODE_OK): Delete. * config/rl78/rl78-protos.h (rl78_hard_regno_mode_ok): Delete. * config/rl78/rl78.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (rl78_hard_regno_mode_ok): Make static and return bool. * config/rs6000/rs6000.h (HARD_REGNO_MODE_OK): Delete. * config/rs6000/rs6000-protos.h (rs6000_hard_regno_mode_ok_p): Delete. * config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok_p): Make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. (rs6000_hard_regno_mode_ok): Rename to... (rs6000_hard_regno_mode_ok_uncached): ...this. (rs6000_init_hard_regno_mode_ok): Update accordingly. (rs6000_hard_regno_mode_ok): New function. * config/rx/rx.h (HARD_REGNO_MODE_OK): Delete. * config/rx/rx.c (rx_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/s390/s390.h (HARD_REGNO_MODE_OK): Delete. * config/s390/s390-protos.h (s390_hard_regno_mode_ok): Delete. * config/s390/s390.c (s390_hard_regno_mode_ok): Make static. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/sh/sh.h (HARD_REGNO_MODE_OK): Delete. * config/sh/sh-protos.h (sh_hard_regno_mode_ok): Delete. * config/sh/sh.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (sh_hard_regno_mode_ok): Make static. * config/sparc/constraints.md: Refer to targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/sparc/sparc.h (hard_regno_mode_classes): Delete. (sparc_mode_class): Delete. (HARD_REGNO_MODE_OK): Delete. * config/sparc/sparc.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (hard_regno_mode_classes): Make static. (sparc_mode_class): Likewise. (sparc_hard_regno_mode_ok): New function. * config/spu/spu.h (HARD_REGNO_MODE_OK): Delete. * config/stormy16/stormy16.h (HARD_REGNO_MODE_OK): Delete. * config/stormy16/stormy16.c (xstormy16_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/tilegx/tilegx.h (HARD_REGNO_MODE_OK): Delete. * config/tilepro/tilepro.h (HARD_REGNO_MODE_OK): Delete. * config/v850/v850.h (HARD_REGNO_MODE_OK): Delete. * config/v850/v850.c (v850_hard_regno_mode_ok): New function. (TARGET_HARD_REGNO_MODE_OK): Redefine. * config/vax/vax.h (HARD_REGNO_MODE_OK): Delete. * config/visium/visium.h (HARD_REGNO_MODE_OK): Delete. * config/visium/visium.c (TARGET_HARD_REGNO_MODE_OK): Redefine. (visium_hard_regno_mode_ok): New function. * config/visium/visium.md: Refer to targetm.hard_regno_mode_ok instead of HARD_REGNO_MODE_OK. * config/xtensa/xtensa.h (xtensa_hard_regno_mode_ok): Delete. (HARD_REGNO_MODE_OK): Delete. * config/xtensa/xtensa.c (xtensa_hard_regno_mode_ok): Rename to... (xtensa_hard_regno_mode_ok_p): ...this and make static. (xtensa_option_override): Update accordingly. (TARGET_HARD_REGNO_MODE_OK): Redefine. (xtensa_hard_regno_mode_ok): New function. * system.h (HARD_REGNO_MODE_OK): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251646
2017-09-04Turn HARD_REGNO_CALL_PART_CLOBBERED into a target hookRichard Sandiford
The SVE patches change the size of a machine_mode from a compile-time constant to a runtime invariant. However, target-specific code can continue to treat the modes as constant-sized if the target only has constant-sized modes. The main snag with this approach is that target-independent code still uses macros from the target .h file. This patch is one of several that converts a target macro to a hook. 2017-09-04 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (hard_regno_call_part_clobbered): New hook. * doc/tm.texi.in (HARD_REGNO_CALL_PART_CLOBBERED): Replace with... (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): ...this hook. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_uint_mode_false): Declare. * hooks.c (hook_bool_uint_mode_false): New function. * regs.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * cselib.c (cselib_process_insn): Use targetm.hard_regno_call_part_clobbered instead of HARD_REGNO_CALL_PART_CLOBBERED. * ira-conflicts.c (ira_build_conflicts): Likewise. * ira-costs.c (ira_tune_allocno_costs): Likewise. * lra-constraints.c (need_for_call_save_p): Likewise. * lra-lives.c: Include target.h. (check_pseudos_live_through_calls): Use targetm.hard_regno_call_part_clobbered instead of HARD_REGNO_CALL_PART_CLOBBERED. * regcprop.c: Include target.h. (copyprop_hardreg_forward_1): Use targetm.hard_regno_call_part_clobbered instead of HARD_REGNO_CALL_PART_CLOBBERED. * reginfo.c (choose_hard_reg_mode): Likewise. * regrename.c (check_new_reg_p): Likewise. * reload.c (find_equiv_reg): Likewise. * reload1.c (emit_reload_insns): Likewise. * sched-deps.c (deps_analyze_insn): Likewise. * sel-sched.c (init_regs_for_mode): Likewise. (mark_unavailable_hard_regs): Likewise. * targhooks.c (default_dwarf_frame_reg_mode): Likewise. * config/aarch64/aarch64.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/aarch64/aarch64.c (aarch64_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/avr/avr-protos.h (avr_hard_regno_call_part_clobbered): Delete. * config/avr/avr.c (avr_hard_regno_call_part_clobbered): Make static and return a bool. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/i386/i386.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/i386/i386.c (ix86_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/mips/mips.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/mips/mips.c (mips_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/powerpcspe/powerpcspe.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/powerpcspe/powerpcspe.c (rs6000_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/rs6000/rs6000.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/rs6000/rs6000.c (rs6000_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/s390/s390.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * config/s390/s390.c (s390_hard_regno_call_part_clobbered): New function. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Redefine. * config/sh/sh.h (HARD_REGNO_CALL_PART_CLOBBERED): Delete. * system.h (HARD_REGNO_CALL_PART_CLOBBERED): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251645
2017-01-01Update copyright years.Jakub Jelinek
From-SVN: r243994
2016-11-10target.def (additional_allocno_class_p): New.Vladimir Makarov
2016-11-10 Vladimir Makarov <vmakarov@redhat.com> * target.def (additional_allocno_class_p): New. * hooks.h (hook_bool_reg_class_t_false): New prototype. * hooks.c (hook_bool_reg_class_t_false): New. * ira.c (setup_allocno_and_important_classes): Use the new hook. * doc/tm.texi.in (TARGET_ADDITIONAL_ALLOCNO_CLASS_P): Add it. * doc/tm.texi: Update. From-SVN: r242043
2016-10-13re PR target/77957 (Undefined .LCTOC0 with -fstack-protector-strong ↵Jakub Jelinek
-mminimal-toc -O0 on ppc64) PR target/77957 * hooks.h (hook_tree_void_null): Declare. * hooks.c (hook_tree_void_null): New function. * langhooks.c (lhd_return_null_tree_v): Remove. * langhooks-def.h (lhd_return_null_tree_v): Remove. * cfgexpand.c (stack_protect_prologue): If guard_decl is NULL, set y to const0_rtx. * function.c (stack_protect_epilogue): Likewise. * config/tilepro/tilepro.c (TARGET_STACK_PROTECT_GUARD): Redefine if TARGET_THREAD_SSP_OFFSET is defined. * config/s390/s390.c (TARGET_STACK_PROTECT_GUARD): Likewise. * config/sparc/sparc.c (TARGET_STACK_PROTECT_GUARD): Likewise. * config/tilegx/tilegx.c (TARGET_STACK_PROTECT_GUARD): Likewise. * config/rs6000/rs6000.c (TARGET_STACK_PROTECT_GUARD): Likewise. * config/i386/i386.c (TARGET_STACK_PROTECT_GUARD): Likewise. (ix86_stack_protect_guard): New function. c/ * c-objc-common.h (LANG_HOOKS_GETDECLS): Use hook_tree_void_null instead of lhd_return_null_tree_v. ada/ * gcc-interface/misc.c (LANG_HOOKS_GETDECLS): Use hook_tree_void_null instead of lhd_return_null_tree_v. From-SVN: r241087
2016-09-23hooks.c (hook_bool_bool_false, [...]): For arguments with ATTRIBUTE_UNUSED...Jakub Jelinek
* hooks.c (hook_bool_bool_false, hook_bool_bool_gcc_optionsp_false, hook_bool_mode_false, hook_bool_mode_true, hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_const_rtx_insn_const_rtx_insn_true, hook_bool_mode_uhwi_false, hook_void_FILEptr_constcharptr, hook_bool_FILEptr_rtx_false, hook_bool_gsiptr_false, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, default_can_output_mi_thunk_no_vcall, hook_int_uint_mode_1, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_int_rtx_0, hook_int_rtx_bool_0, hook_void_tree, hook_void_constcharptr, hook_void_tree_treeptr, hook_void_int_int, hook_bool_tree_false, hook_bool_const_tree_false, hook_bool_tree_true, hook_bool_const_tree_true, hook_bool_tree_tree_false, hook_bool_tree_tree_true, hook_bool_tree_bool_false, hook_bool_rtx_insn_true, hook_bool_rtx_false, hook_bool_uintp_uintp_false, hook_bool_rtx_mode_int_int_intp_bool_false, hook_rtx_rtx_null, hook_rtx_tree_int_null, hook_uint_mode_0, hook_constcharptr_const_tree_null, hook_tree_tree_int_treep_bool_null, hook_tree_tree_tree_null, hook_tree_tree_tree_tree_null, hook_constcharptr_const_rtx_insn_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null, hook_tree_const_tree_null, hook_bool_rtx_insn_int_false, hook_void_rtx_insn_int, hook_void_gcc_optionsp): For arguments with ATTRIBUTE_UNUSED, remove parameter name as well as ATTRIBUTE_UNUSED. From-SVN: r240452
2016-09-23hooks.h (hook_uint_uintp_false): Rename to...Uros Bizjak
* hooks.h (hook_uint_uintp_false): Rename to... (hook_bool_uint_uintp_false): ... this. * hooks.c (hook_uint_uintp_false): Rename to... (hook_bool_uint_uintp_false): ... this. * target.def (elf_flags_numeric): Use hook_bool_uint_uintp_false instead of hook_uint_uintp_false. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r240417
2016-09-22[ARM] Add support for -mpure-code optionAndre Vieira
gcc/ChangeLog: 2016-09-22 Andre Vieira <andre.simoesdiasvieira@arm.com> Terry Guo <terry.guo@arm.com> * target.def (elf_flags_numeric): New target hook. * targhooks.h (default_asm_elf_flags_numeric): New. * varasm.c (default_asm_elf_flags_numeric): New. (default_elf_asm_named_section): Use new target hook. * config/arm/arm.opt (mpure-code): New. * config/arm/arm.h (SECTION_ARM_PURECODE): New. * config/arm/arm.c (arm_asm_init_sections): Add section attribute to default text section if -mpure-code. (arm_option_check_internal): Diagnose use of option with non supported targets and/or options. (arm_asm_elf_flags_numeric): New. (arm_function_section): New. (arm_elf_section_type_flags): New. * config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Disable for -mpure-code. * gcc/doc/texi (TARGET_ASM_ELF_FLAGS_NUMERIC): New. * gcc/doc/texi.in (TARGET_ASM_ELF_FLAGS_NUMERIC): Likewise. gcc/testsuite/ChangeLog: 2016-09-22 Andre Vieira <andre.simoesdiasvieira@arm.com> Terry Guo <terry.guo@arm.com> * gcc.target/arm/pure-code/ffunction-sections.c: New. * gcc.target/arm/pure-code/no-literal-pool.c: New. * gcc.target/arm/pure-code/pure-code.exp: New. Co-Authored-By: Terry Guo <terry.guo@arm.com> From-SVN: r240379
2016-01-04Update copyright years.Jakub Jelinek
From-SVN: r232055
2015-07-08target.def (rtx_costs): Remove "code" param, add "mode".Alan Modra
* target.def (rtx_costs): Remove "code" param, add "mode". * rtl.h (rtx_cost, get_full_rtx_cost): Update prototype. (set_src_cost, get_full_set_src_cost): Likewise. Move later in file. (set_rtx_cost, get_full_set_rtx_cost): Move later in file. * rtlanal.c (rtx_cost): Add "mode" parameter. Update targetm.rtx_costs call. Track mode when given in rtx. (get_full_rtx_cost): Add "mode" parameter. Update rtx_cost calls. (default_address_cost): Pass Pmode to rtx_cost. (insn_rtx_cost): Pass dest mode of set to set_src_cost. * cprop.c (try_replace_reg): Ensure set_rtx_cost is not called with NULL set. * cse.c (COST, COST_IN): Add MODE param. Update all uses. (notreg_cost): Add mode param. Use it. * gcse.c (want_to_gcse_p): Delete forward declaration. Add mode param and pass to set_src_cost. Update all calls. (hash_scan_set): Formatting. * hooks.c (hook_bool_rtx_int_int_int_intp_bool_false): Delete. (hook_bool_rtx_mode_int_int_intp_bool_false): New function. * hooks.h: Ditto. * expmed.c (init_expmed_one_conv, init_expmed_one_mode, init_expmed, expand_mult, mult_by_coeff_cost, expand_smod_pow2, emit_store_flag): Update set_src_cost and rtx_cost calls. * auto-inc-dec.c (attempt_change): Likewise. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction, force_to_mode, distribute_and_simplify_rtx): Likewise. * dojump.c (prefer_and_bit_test): Likewise. * dse.c (find_shift_sequence): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * lower-subreg.c (shift_cost, compute_costs): Likewise. * optabs.c (avoid_expensive_constant, prepare_cmp_insn, lshift_cheap_p): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns, note_reg_elim_costly): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Delete "code" param, add "mode" param. Use "mode: in place of GET_MODE (x). Pass mode to rtx_cost calls. * config/alpha/alpha.c (alpha_rtx_costs): Likewise. * config/arc/arc.c (arc_rtx_costs): Likewise. * config/arm/arm.c (arm_rtx_costs): Likewise. * config/avr/avr.c (avr_rtx_costs, avr_rtx_costs_1): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/epiphany/epiphany.c (epiphany_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_rtx_costs): Likewise. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_rtx_costs): Likewise. * config/msp430/msp430.c (msp430_rtx_costs): Likewise. * config/nds32/nds32-cost.c (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32-protos.h (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32.c (nds32_rtx_costs): Likewise. * config/nios2/nios2.c (nios2_rtx_costs): Likewise. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/rl78/rl78.c (rl78_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/tilegx/tilegx.c (tilegx_rtx_costs): Likewise. * config/tilepro/tilepro.c (tilepro_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/visium/visium.c (visium_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Change type of "code" param, and pass as outer_code to first rtx_cost call. Pass mode to rtx_cost calls. (aarch64_address_cost, aarch64_if_then_else_costs): Update rtx_cost calls. (aarch64_rtx_costs_wrapper): Update. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs, arm_unspec_cost, arm_new_rtx_costs, arm_slowmul_rtx_costs): Update rtx_cost calls. * config/avr/avr.c (avr_final_prescan_insn): Update set_src_cost and rtx_cost calls. (avr_operand_rtx_cost): Similarly. (avr_rtx_costs_1): Correct mode passed to avr_operand_rtx_cost for subexpressions of ZERO_EXTEND, SIGN_EXTEND and COMPARE. * config/mips/mips.c (mips_stack_address_p): Comment typo. (mips_binary_cost): Update rtx_cost and set_src_cost calls. (mips_rtx_costs): Use GET_MODE (x) to detect const_int. * config/mn10300/mn10300.c (mn10300_address_cost): Pass Pmode to rtx_cost. (mn10300_rtx_costs): Correct mode passed to mn10300_address_cost. * config/rs6000/rs6000.c (rs6000_debug_rtx_costs): Update. * config/sh/sh.c (and_xor_ior_costs): Update rtx_cost call. * doc/tm.texi: Regenerate. From-SVN: r225532
2015-05-11Convert to md_asm_adjustRichard Henderson
Using proper vectors instead of lists of trees. From-SVN: r223025
2015-01-05Update copyright years.Jakub Jelinek
From-SVN: r219188
2014-11-13[PATCH 6/7] OpenMP 4.0 offloading infrastructure: option handling.Bernd Schmidt
gcc/ * common.opt (foffload, foffload-abi): New options. * config/i386/i386.c (ix86_offload_options): New static function. (TARGET_OFFLOAD_OPTIONS): Define. * coretypes.h (enum offload_abi): New enum. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_OFFLOAD_OPTIONS): Document. * gcc.c (offload_targets): New static variable. (handle_foffload_option): New static function. (driver_handle_option): Handle OPT_foffload_. (driver::maybe_putenv_OFFLOAD_TARGETS): Set OFFLOAD_TARGET_NAMES according to offload_targets. * hooks.c (hook_charptr_void_null): New hook. * hooks.h (hook_charptr_void_null): Declare. * lto-opts.c: Include lto-section-names.h. (lto_write_options): Append options from target offload_options hook and store them to offload_lto section. Do not store target-specific, driver and diagnostic options in offload_lto section. * lto-wrapper.c (merge_and_complain): Handle OPT_foffload_ and OPT_foffload_abi_. (append_compiler_options, append_linker_options) (append_offload_options): New static functions. (compile_offload_image): Add new arguments with options. Call append_compiler_options and append_offload_options. (compile_images_for_offload_targets): Add new arguments with options. (find_and_merge_options): New static function. (run_gcc): Outline options handling into the new functions: find_and_merge_options, append_compiler_options, append_linker_options. * opts.c (common_handle_option): Don't handle OPT_foffload_. Forbid OPT_foffload_abi_ for non-offload compiler. * target.def (offload_options): New target hook. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> From-SVN: r217493
2014-11-10Add a target hook for assembling undeclared decls.Bernd Schmidt
* target.def (assemble_undefined_decl): New hooks. * hooks.c (hook_void_FILEptr_constcharptr_const_tree): New function. * hooks.h (hook_void_FILEptr_constcharptr_const_tree): Declare. * doc/tm.texi.in (TARGET_ASM_ASSEMBLE_UNDEFINED_DECL): Add. * doc/tm.texi: Regenerate. * output.h (assemble_undefined_decl): Declare. (get_fnname_from_decl): Declare. * varasm.c (assemble_undefined_decl): New function. (get_fnname_from_decl): New function. * final.c (rest_of_handle_final): Use it. * varpool.c (varpool_output_variables): Call assemble_undefined_decl for nodes without a definition. From-SVN: r217293
2014-11-06Add a hook to inform a port about call arguments.Bernd Schmidt
* target.def (call_args, end_call_args): New hooks. * hooks.c (hook_void_rtx_tree): New empty function. * hooks.h (hook_void_rtx_tree): Declare. * doc/tm.texi.in (TARGET_CALL_ARGS, TARGET_END_CALL_ARGS): Add. * doc/tm.texi: Regenerate. * calls.c (expand_call): Slightly rearrange the code. Use the two new hooks. (expand_library_call_value_1): Use the two new hooks. From-SVN: r217199
2014-10-29decl.c, [...]: Remove redundant enum from machine_mode.Richard Sandiford
gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-09-15Instruction attributes take an rtx_insn *David Malcolm
gcc/ChangeLog: * config/arc/arc-protos.h (arc_attr_type): Strengthen param from rtx to rtx_insn *. (arc_sets_cc_p): Likewise. * config/arc/arc.c (arc_print_operand): Use methods of "final_sequence" for clarity, and to enable strengthening of locals "jump" and "delay" from rtx to rtx_insn *. (arc_adjust_insn_length): Strengthen local "prev" from rtx to rtx_insn *; use method of rtx_sequence for typesafety. (arc_get_insn_variants): Use insn method of rtx_sequence for typesafety. (arc_pad_return): Likewise. (arc_attr_type): Strengthen param from rtx to rtx_insn *. (arc_sets_cc_p): Likewise. Also, convert a GET_CODE check to a dyn_cast to rtx_sequence *, using insn method for typesafety. * config/arc/arc.h (ADJUST_INSN_LENGTH): Add checked casts to rtx_sequence * and use insn method when invoking get_attr_length. * config/bfin/bfin.c (type_for_anomaly): Strengthen param from rtx to rtx_insn *. Replace a GET_CODE check with a dyn_cast to rtx_sequence *, introducing a local "seq", using its insn method from typesafety and clarity. (add_sched_insns_for_speculation): Strengthen local "next" from rtx to rtx_insn *. * config/c6x/c6x.c (get_insn_side): Likewise for param "insn". (predicate_insn): Likewise. * config/cris/cris-protos.h (cris_notice_update_cc): Likewise for second param. * config/cris/cris.c (cris_notice_update_cc): Likewise. * config/epiphany/epiphany-protos.h (extern void epiphany_insert_mode_switch_use): Likewise for param "insn". (get_attr_sched_use_fpu): Likewise for param. * config/epiphany/epiphany.c (epiphany_insert_mode_switch_use): Likewise for param "insn". * config/epiphany/mode-switch-use.c (insert_uses): Likewise for param "insn" of "target_insert_mode_switch_use" callback. * config/frv/frv.c (frv_insn_unit): Likewise for param "insn". (frv_issues_to_branch_unit_p): Likewise. (frv_pack_insn_p): Likewise. (frv_compare_insns): Strengthen locals "insn1" and "insn2" from const rtx * (i.e. mutable rtx_def * const *) to rtx_insn * const *. * config/i386/i386-protos.h (standard_sse_constant_opcode): Strengthen first param from rtx to rtx_insn *. (output_fix_trunc): Likewise. * config/i386/i386.c (standard_sse_constant_opcode): Likewise. (output_fix_trunc): Likewise. (core2i7_first_cycle_multipass_filter_ready_try): Likewise for local "insn". (min_insn_size): Likewise for param "insn". (get_mem_group): Likewise. (is_cmp): Likewise. (get_insn_path): Likewise. (get_insn_group): Likewise. (count_num_restricted): Likewise. (fits_dispatch_window): Likewise. (add_insn_window): Likewise. (add_to_dispatch_window): Likewise. (debug_insn_dispatch_info_file): Likewise. * config/m32c/m32c-protos.h (m32c_output_compare): Likewise for first param. * config/m32c/m32c.c (m32c_compare_redundant): Likewise for param "cmp" and local "prev". (m32c_output_compare): Likewise for param "insn". * config/m32r/predicates.md (define_predicate "small_insn_p"): Add a checked cast to rtx_insn * on "op" after we know it's an INSN_P. (define_predicate "large_insn_p"): Likewise. * config/m68k/m68k-protos.h (m68k_sched_attr_size): Strengthen param from rtx to rtx_insn *. (attr_op_mem m68k_sched_attr_op_mem): Likewise. * config/m68k/m68k.c (sched_get_attr_size_int): Likewise. (m68k_sched_attr_size): Likewise. (sched_get_opxy_mem_type): Likewise for param "insn". (m68k_sched_attr_op_mem): Likewise. (sched_mem_operand_p): Likewise. * config/mep/mep-protos.h (mep_multi_slot): Likewise for param. * config/mep/mep.c (mep_multi_slot): Likewise. * config/mips/mips-protos.h (mips_output_sync_loop): Likewise for first param. (mips_sync_loop_insns): Likewise. * config/mips/mips.c (mips_print_operand_punctuation): Use insn method of "final_sequence" for typesafety. (mips_process_sync_loop): Strengthen param "insn" from rtx to rtx_insn *. (mips_output_sync_loop): Likewise. (mips_sync_loop_insns): Likewise. (mips_74k_agen_init): Likewise. (mips_sched_init): Use NULL rather than NULL_RTX when working with insns. * config/nds32/nds32-fp-as-gp.c (nds32_symbol_load_store_p): Strengthen param "insn" from rtx to rtx_insn *. * config/nds32/nds32.c (nds32_target_alignment): Likewise for local "insn". * config/pa/pa-protos.h (pa_insn_refs_are_delayed): Likewise for param. * config/pa/pa.c (pa_output_function_epilogue): Likewise for local "insn". Use method of rtx_sequence for typesafety. (branch_to_delay_slot_p): Strengthen param "insn" from rtx to rtx_insn *. (branch_needs_nop_p): Likewise. (use_skip_p): Likewise. (pa_insn_refs_are_delayed): Likewise. * config/rl78/rl78.c (rl78_propogate_register_origins): Likewise for locals "insn", "ninsn". * config/rs6000/rs6000.c (is_microcoded_insn): Likewise for param "insn". (is_cracked_insn): Likewise. (is_branch_slot_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_terminates_group_p): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise for param "next_insn". * config/s390/s390.c (s390_get_sched_attrmask): Likewise for param "insn". (s390_sched_score): Likewise. * config/sh/sh-protos.h (output_branch): Likewise for param 2. (rtx sfunc_uses_reg): Likewise for sole param. * config/sh/sh.c (sh_print_operand): Use insn method of final_sequence for typesafety. (output_branch): Strengthen param "insn" from rtx to rtx_insn *. Use insn method of final_sequence for typesafety. (sfunc_uses_reg): Strengthen param "insn" from rtx to rtx_insn *. * config/sparc/sparc-protos.h (eligible_for_call_delay): Likewise for param. (eligible_for_return_delay): Likewise. (eligible_for_sibcall_delay): Likewise. * config/sparc/sparc.c (eligible_for_call_delay): Likewise. (eligible_for_return_delay): Likewise. (eligible_for_sibcall_delay): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_output_cbranch_hi): Likewise for final param. (xstormy16_output_cbranch_si): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi): LIkewise. (xstormy16_output_cbranch_si): Likewise. * config/v850/v850-protos.h (notice_update_cc): Likewise. * config/v850/v850.c (notice_update_cc): Likewise. * final.c (get_attr_length_1): Strengthen param "insn" and param of "fallback_fn" from rtx to rtx_insn *, eliminating a checked cast. (get_attr_length): Strengthen param "insn" from rtx to rtx_insn *. (get_attr_min_length): Likewise. (shorten_branches): Likewise for signature of locals "length_fun" and "inner_length_fun". Introduce local rtx_sequence * "seqn" from a checked cast and use its methods for clarity and to enable strengthening local "inner_insn" from rtx to rtx_insn *. * genattr.c (gen_attr): When writing out the prototypes of the various generated "get_attr_" functions, strengthen the params of the non-const functions from rtx to rtx_insn *. Similarly, strengthen the params of insn_default_length, insn_min_length, insn_variable_length_p, insn_current_length. (main): Similarly, strengthen the param of num_delay_slots, internal_dfa_insn_code, insn_default_latency, bypass_p, insn_latency, min_issue_delay, print_reservation, insn_has_dfa_reservation_p and of the "internal_dfa_insn_code" and "insn_default_latency" callbacks. Rename hook_int_rtx_unreachable to hook_int_rtx_insn_unreachable. * genattrtab.c (write_attr_get): When writing out the generated "get_attr_" functions, strengthen the param "insn" from rtx to rtx_insn *, eliminating a checked cast. (make_automaton_attrs): When writing out prototypes of "internal_dfa_insn_code_", "insn_default_latency_" functions and the "internal_dfa_insn_code" and "insn_default_latency" callbacks, strengthen their params from rtx to rtx_insn * * genautomata.c (output_internal_insn_code_evaluation): When writing out code, add a checked cast from rtx to rtx_insn * when invoking DFA_INSN_CODE_FUNC_NAME aka dfa_insn_code. (output_dfa_insn_code_func): Strengthen param of generated function "dfa_insn_code_enlarge" from rtx to rtx_insn *. (output_trans_func): Likewise for generated function "state_transition". (output_internal_insn_latency_func): When writing out generated function "internal_insn_latency", rename params from "insn" and "insn2" to "insn_or_const0" and "insn2_or_const0". Reintroduce locals "insn" and "insn2" as rtx_insn * with checked casts once we've proven that we're not dealing with const0_rtx. (output_insn_latency_func): Strengthen param of generated function "insn_latency" from rtx to rtx_insn *. (output_print_reservation_func): Likewise for generated function "print_reservation". (output_insn_has_dfa_reservation_p): Likewise for generated function "insn_has_dfa_reservation_p". * hooks.c (hook_int_rtx_unreachable): Rename to... (hook_int_rtx_insn_unreachable): ...this, and strengthen param from rtx to rtx_insn *. * hooks.h (hook_int_rtx_unreachable): Likewise. (extern int hook_int_rtx_insn_unreachable): Likewise. * output.h (get_attr_length): Strengthen param from rtx to rtx_insn *. (get_attr_min_length): Likewise. * recog.c (get_enabled_alternatives): Likewise. * recog.h (alternative_mask get_enabled_alternatives): Likewise. * reorg.c (find_end_label): Introduce local rtx "pat" and strengthen local "insn" from rtx to rtx_insn *. (redundant_insn): Use insn method of "seq" rather than element for typesafety; strengthen local "control" from rtx to rtx_insn *. * resource.c (mark_referenced_resources): Add checked cast to rtx_insn * within INSN/JUMP_INSN case. (mark_set_resources): Likewise. * sel-sched.c (estimate_insn_cost): Strengthen param "insn" from rtx to rtx_insn *. From-SVN: r215271
2014-09-15The TARGET_CAN_FOLLOW_JUMP hook takes insnsDavid Malcolm
gcc/ChangeLog: * config/arc/arc.c (arc_can_follow_jump): Strengthen both params from const_rtx to const rtx_insn *. Update union members from rtx to rtx_insn *. * doc/tm.texi (TARGET_CAN_FOLLOW_JUMP): Autogenerated change. * hooks.c (hook_bool_const_rtx_const_rtx_true): Rename to... (hook_bool_const_rtx_insn_const_rtx_insn_true): ...this, and strengthen both params from const_rtx to const rtx_insn *. * hooks.h (hook_bool_const_rtx_const_rtx_true): Likewise. (hook_bool_const_rtx_insn_const_rtx_insn_true): Likewise. * reorg.c (follow_jumps): Strengthen param "jump" from rtx to rtx_insn *. * target.def (can_follow_jump): Strengthen both params from const_rtx to const rtx_insn *, and update default implementation from hook_bool_const_rtx_const_rtx_true to hook_bool_const_rtx_insn_const_rtx_insn_true. From-SVN: r215269
2014-08-27Use rtx_insn for various target.def hooksDavid Malcolm
gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-05-06Merge in wide-int.Kenneth Zadeck
From-SVN: r210113
2014-01-02Update copyright years in gcc/Richard Sandiford
From-SVN: r206289
2013-11-22hooks.h (hook_uint_mode_0): Add Prototype.Andrew MacLeod
* hooks.h (hook_uint_mode_0): Add Prototype. * hooks.c (hook_uint_mode_0): New default function. * target.def (atomic_align_for_mode): New target hook. * tree.c (build_atomic_base): Add alignment override parameter. (build_common_tree_nodes): Use atomic alignment override. * doc/tm.texi.in (TARGET_ATOMIC_ALIGN_FOR_MODE): Define. * doc/tm.texi (TARGET_ATOMIC_ALIGN_FOR_MODE): Add description. From-SVN: r205273
2013-11-09target.def (can_use_doloop_p): New hook.Richard Sandiford
gcc/ * target.def (can_use_doloop_p): New hook. * doc/tm.texi.in (TARGET_CAN_USE_DOLOOP_P): Add. * doc/tm.texi: Regenerate. * doc/md.texi (doloop_begin, doloop_end): Update documentation. * hooks.h (hook_bool_dint_dint_uint_true): Declare. * hooks.c (hook_bool_dint_dint_uint_true): New function. * targhooks.h (can_use_doloop_if_innermost): Declare. * targhooks.c (can_use_doloop_if_innermost): New function. * target.h: Include double-int.h. * loop-doloop.c (doloop_optimize): Call targetm.can_use_doloop_p. Remove iteration count, maximum iteration count, loop depth and enter-at-top inputs from doloop_begin and doloop_end. * config/arc/arc.md (doloop_begin, doloop_end): Update for new interface. * config/arc/arc.c (arc_can_use_doloop_p): New function. (TARGET_CAN_USE_DOLOOP_P): Define. * config/arm/thumb2.md (doloop_end): Update for new interface. * config/arm/arm.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/bfin/bfin.md (doloop_end): Update for new interface. * config/bfin/bfin.c (bfin_can_use_doloop_p): New function. (TARGET_CAN_USE_DOLOOP_P): Define. * config/c6x/c6x.md (doloop_end): Update for new interface. * config/ia64/ia64.md (doloop_end): Update for new interface. * config/ia64/ia64.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/mep/mep.md (doloop_begin, doloop_end): Update for new interface. * config/mep/mep.c (mep_emit_doloop): Likewise. (TARGET_CAN_USE_DOLOOP_P): Define. * config/rs6000/rs6000.md (doloop_end): Update for new interface. * config/rs6000/rs6000.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/s390/s390.md (doloop_end): Update for new interface. * config/sh/sh.md (doloop_end): Likewise. * config/spu/spu.md (doloop_end): Likewise. * config/spu/spu.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/tilegx/tilegx.md (doloop_end): Update for new interface. * config/tilegx/tilegx.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/tilepro/tilepro.md (doloop_end): Update for new interface. * config/tilepro/tilepro.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/v850/v850.md (doloop_begin, doloop_end): Update for new interface. * config/v850/v850.c (TARGET_CAN_USE_DOLOOP_P): Define. From-SVN: r204614
2013-04-22[Mid-end] Add TARGET_GIMPLE_FOLD_BUILTIN target hook.James Greenhalgh
gcc/ * coretypes.h (gimple_stmt_iterator_d): Forward declare. (gimple_stmt_iterator): New typedef. * gimple.h (gimple_stmt_iterator): Rename to... (gimple_stmt_iterator_d): ... This. * doc/tm.texi.in (TARGET_FOLD_BUILTIN): Detail restriction that trees be valid for GIMPLE and GENERIC. (TARGET_GIMPLE_FOLD_BUILTIN): New. * gimple-fold.c (gimple_fold_call): Call target hook gimple_fold_builtin. * hooks.c (hook_bool_gsiptr_false): New. * hooks.h (hook_bool_gsiptr_false): New. * target.def (fold_stmt): New. * doc/tm.texi: Regenerate. From-SVN: r198142
2013-01-10Update copyright years in gcc/Richard Sandiford
From-SVN: r195098
2012-11-05md.texi (Defining Attributes): Document that we are defining HAVE_ATTR_name ↵Joern Rennecke
macors as 1 for defined attributes... * doc/md.texi (Defining Attributes): Document that we are defining HAVE_ATTR_name macors as 1 for defined attributes, and as 0 for undefined special attributes. * final.c (asm_insn_count, align_fuzz): Always define. (insn_current_reference_address): Likewise. (init_insn_lengths): Use if (HAVE_ATTR_length) instead of #ifdef HAVE_ATTR_length. (get_attr_length_1, shorten_branches, final): Likewise. (final_scan_insn, output_asm_name): Likewise. * genattr.c (gen_attr): Define HAVE_ATTR_name macros for defined attributes as 1. Remove ancient get_attr_alternative compatibility code. For special purpose attributes not provided, define HAVE_ATTR_name as 0. In case no length attribute is given, provide stub definitions for insn_*_length* functions, and also include insn-addr.h. In case no enabled attribute is given, provide stub definition. * genattrtab.c (write_length_unit_log): Always write a definition. * hooks.c (hook_int_rtx_1, hook_int_rtx_unreachable): New functions. * hooks.h (hook_int_rtx_1, hook_int_rtx_unreachable): Declare. * lra-int.h (struct lra_insn_recog_data): Make member alternative_enabled_p unconditional. * lra.c (free_insn_recog_data): Use if (HAVE_ATTR_length) instead of #ifdef HAVE_ATTR_length. (lra_set_insn_recog_data): Likewise. Make initialization of alternative_enabled_p unconditional. (lra_update_insn_recog_data): Use #if instead of #ifdef for HAVE_ATTR_enabled. * recog.c [!HAVE_ATTR_enabled] (get_attr_enabled): Don't define. (extract_insn): Check HAVE_ATTR_enabled. (gate_handle_split_before_regstack): Use #if instead of #if defined for HAVE_ATTR_length. From-SVN: r193168
2012-10-23gcc:Joseph Myers
* config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu): Use glibc-c.o in c_target_objs and cxx_target_objs. Use t-glibc in tmake_file. Set target_has_targetcm. (tilegx-*-linux*, tilepro-*-linux*): Append to c_target_objs and cxx_target_objs rather than overriding previous value. * config/glibc-c.c, config/t-glibc: New. * doc/tm.texi.in (TARGET_C_PREINCLUDE): New @hook. * doc/tm.texi: Regenerate. * hooks.c (hook_constcharptr_void_null): New. * hooks.h (hook_constcharptr_void_null): Declare. gcc/c-family: * c-common.h (pch_cpp_save_state): Declare. * c-target.def (c_preinclude): New hook. * c-opts.c (done_preinclude): New. (push_command_line_include): Handle default preincluded header. (cb_file_change): Call pch_cpp_save_state when calling push_command_line_include. * c-pch.c (pch_ready_to_save_cpp_state, pch_cpp_state_saved) (pch_cpp_save_state): New. (pch_init): Call pch_cpp_save_state conditionally, instead of calling cpp_save_state. gcc/testsuite: * gcc.dg/c99-predef-1.c: New test. * gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c, gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c, gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c, gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c, gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c, gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c, gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c, gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c, gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c, gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c, gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c, gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to dg-options. libcpp: * files.c (struct _cpp_file): Add implicit_preinclude. (pch_open_file): Allow a previously opened implicitly included file. (_cpp_find_file): Add implicit_preinclude argument. Free file and do not call open_file_failed if implicit_preinclude. Store implicit_preinclude value. (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date): Update calls to _cpp_find_file. (_cpp_stack_include): Handle IT_DEFAULT. (cpp_push_default_include): New. * include/cpplib.h (cpp_push_default_include): Declare. * init.c (cpp_read_main_file): Update call to _cpp_find_file. * internal.h (enum include_type): Add IT_DEFAULT. (_cpp_find_file): Update prototype. From-SVN: r192715
2012-09-30re PR rtl-optimization/38449 (delay branch scheduling follows ↵Joern Rennecke
REG_CROSSING_JUMP jumps indiscriminately) PR rtl-optimization/38449: * hooks.c (hook_bool_const_rtx_const_rtx_true): New function. * hooks.h (hook_bool_const_rtx_const_rtx_true): Declare. * target.def: Merge in definitions and documentation for TARGET_CAN_FOLLOW_JUMP. * doc/tm.texi.in: Add documentation locations for the above. * doc/tm.texi: Regenerate. * reorg.c (follow_jumps): New parameters jump and crossing. Changed all callers. From-SVN: r191878
2012-09-05hooks.c (hook_int_rtx_mode_as_bool_0): New function.Oleg Endo
* hooks.c (hook_int_rtx_mode_as_bool_0): New function. * hooks.h (hook_int_rtx_mode_as_bool_0): Declare it. * output.h (default_address_cost): Add machine_mode and address space arguments. * target.def (address_cost): Likewise. * rtlanal.c (address_cost): Pass mode and address space to target hook. (default_address_cost): Add unnamed machine_mode and address space arguments. * doc/tm.texi: Regenerate. * config/alpha/alpha.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/arm/arm.c (arm_address_cost): Add machine_mode and address space arguments. * config/avr/avr.c (avr_address_cost): Likewise. * config/bfin/bfin.c (bfin_address_cost): Likewise. * config/cr16/cr16.c (cr16_address_cost): Likewise. * config/cris/cris.c (cris_address_cost): Likewise. * config/epiphany/epiphany.c (epiphany_address_cost): Likewise. * config/i386/i386.c (ix86_address_cost): Likewise. * config/ia64/ia64.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/iq2000/iq2000.c (iq2000_address_cost): Add machine_mode and address space arguments. Pass them on in recursive invocation. * config/lm32/lm32.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/m32c/m32c.c (m32c_address_cost): Add machine_mode and address space arguments. * config/m32r/m32r.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Likewise. * config/mep/mep.c (mep_address_cost): Add machine_mode and address space arguments. * config/microblaze/microblaze.c (microblaze_address_cost): Likewise. * config/mips/mips.c (mips_address_cost): Likewise. * config/mmix/mmix.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mn10300/mn10300.c (mn10300_address_cost): Add machine_mode and address space arguments. (mn10300_rtx_costs): Pass GET_MODE (x) and MEM_ADDR_SPACE (x) to mn10300_address_cost. * config/pa/pa.c (hppa_address_cost): Add machine_mode and address space arguments. * config/rs6000/rs6000.c (rs6000_debug_address_cost): Likewise. (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/rx/rx.c (rx_address_cost): Add machine_mode and address space arguments. * config/s390/s390.c (s390_address_cost): Likewise. * config/score/score-protos.h (score_address_cost): Likewise. * config/score/score.c (score_address_cost): Likewise. * config/sh/sh.c (sh_address_cost): Likewise. * config/sparc/sparc.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/spu/spu.c (TARGET_ADDRESS_COST): Likewise. * config/stormy16/stormy16.c (xstormy16_address_cost): Add machine_mode and address space arguments. * config/v850/v850.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/vax/vax.c (vax_address_cost): Add machine_mode and address space arguments. * config/xtensa/xtensa (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. From-SVN: r190990
2012-09-01target.def (legitimate_combined_insn): New target hook.Uros Bizjak
* target.def (legitimate_combined_insn): New target hook. * doc/tm.texi.in (TARGET_LEGITIMATE_COMBINED_INSN): New hook. * doc/tm.texi: Regenerated. * combine.c (recog_for_combine): Call targetm.legitimate_combined_insn to allow targets to reject combined insn. * hooks.h (hook_bool_rtx_true): New. * hooks.c (hook_bool_rtx_true): Ditto. From-SVN: r190846
2011-10-06system.h (OUTPUT_ADDR_CONST_EXTRA): Poison.Anatoly Sokolov
* system.h (OUTPUT_ADDR_CONST_EXTRA): Poison. * doc/tm.texi.in (OUTPUT_ADDR_CONST_EXTRA): Remove documentation. * doc/tm.texi: Regenerate. * target.def (output_addr_const_extra): Use hook_bool_FILEptr_rtx_false. * targhooks.c (default_asm_output_addr_const_extra): Remove. * targhooks.h (default_asm_output_addr_const_extra): Remove. * hooks.c (hook_bool_FILEptr_rtx_false): New functions. * hooks.h (hook_bool_FILEptr_rtx_false): Declare. From-SVN: r179630
2011-09-06PR middle-end/44382: Tree reassociation improvementEnkovich Ilya
gcc/ 2011-09-06 Enkovich Ilya <ilya.enkovich@intel.com> PR middle-end/44382 * target.def (reassociation_width): New hook. * doc/tm.texi.in (reassociation_width): Likewise. * doc/tm.texi (reassociation_width): Likewise. * doc/invoke.texi (tree-reassoc-width): New param documented. * hooks.h (hook_int_uint_mode_1): New default hook. * hooks.c (hook_int_uint_mode_1): Likewise. * config/i386/i386.h (ix86_tune_indices): Add X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL. (TARGET_REASSOC_INT_TO_PARALLEL): New. (TARGET_REASSOC_FP_TO_PARALLEL): Likewise. * config/i386/i386.c (initial_ix86_tune_features): Add X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL. (ix86_reassociation_width) implementation of new hook for i386 target. * params.def (PARAM_TREE_REASSOC_WIDTH): New param added. * tree-ssa-reassoc.c (get_required_cycles): New function. (get_reassociation_width): Likewise. (swap_ops_for_binary_stmt): Likewise. (rewrite_expr_tree_parallel): Likewise. (rewrite_expr_tree): Refactored. Part of code moved into swap_ops_for_binary_stmt. (reassociate_bb): Now checks reassociation width to be used and call rewrite_expr_tree_parallel instead of rewrite_expr_tree if needed. gcc/testsuite/ 2011-09-06 Enkovich Ilya <ilya.enkovich@intel.com> * gcc.dg/tree-ssa/pr38533.c (dg-options): Added option --param tree-reassoc-width=1. * gcc.dg/tree-ssa/reassoc-24.c: New test. * gcc.dg/tree-ssa/reassoc-25.c: Likewise. From-SVN: r178602
2011-08-18tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter.Richard Sandiford
gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852