Commit Graph

860 Commits

Author SHA1 Message Date
Richard Sandiford 08d0963a0e configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu.
* configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu.
	* configure: Regenerate.

config/
	* mt-mips16-compat: New file, taken from mt-mips-elfoabi.
	* mt-mips-elfoabi: Include mt-mips16-compat.
	* mt-mips-gnu: New file.

gcc/
	* config.gcc (mips*-*-linux*, mips64*-*-linux*): Add
	mips/t-libgcc-mips16 to tmake_file.
	* config/mips/mips-protos.h (mips_call_type): New enum.
	(mips_pic_base_register, mips_got_load): Declare.
	(mips_restore_gp): Take an rtx argument.
	(mips_use_pic_fn_addr_reg_p): Declare.
	(mips_expand_call): Replace the sibcall_p argument with
	a mips_call_type argument.  Add a lazy_p parameter.
	(mips_split_call): Declare.
	* config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro.
	(MIPS16_PIC_TEMP): Likewise.
	(reg_class): Delete M16_NA_REGS.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
	(SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros.
	(mips_split_hi_p): Declare.
	* config/mips/mips.c (mips_split_hi_p): New array.
	(mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS.
	(mips_got_symbol_type_p): New function.
	(mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P.
	(mips16_stub_function_p): New function.
	(mips16_local_function_p): Likewise.
	(mips_use_pic_fn_addr_reg_p): Likewise.
	(mips_cannot_force_const_mem): Return false for HIGHs.
	Extend CONST_INT and symbolic handling to MIPS16, using
	mips_symbol_insns to check that the base symbol type is a
	legitimate constant.  Reject GOT-based constants if
	TARGET_MIPS16_PCREL_LOADS.
	(mips_const_insns): Check targetm.cannot_force_const_mem when
	decomposing a symbolic base and a large offset.
	(mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters.
	When calling a function that needs $25 from MIPS16 code,
	move the target address into $25 separately and add a USE
	to the call insn.
	(mips16_gp_pseudo_reg): Insert the initializer immediately
	before the first real insn.
	(mips_pic_base_register, mips_got_load): New functions.
	(mips_split_symbol): Generalize the name of the LO_SUM_OUT
	parameter to LOW_OUT.  Say that it can be any valid SET_SRC
	when splitting a load-address operation.  Split SYMBOL_GOT_DISP
	constants and highs of SYMBOL_GOT_PAGE_OFST constants.
	(mips_call_tls_get_addr): Update the call to mips_expand_call,
	also passing NULL_RTX rather than const0_rtx as the aux argument.
	(mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p
	instead of TARGET_EXPLICIT_RELOCS.
	(mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P.
	(mips_load_call_address): Replace the sibcall_p argument with
	a mips_call_type argument.  Use mips_got_load.
	(mips16_local_alias): New structure.
	(mips16_local_aliases): New variable.
	(mips16_local_aliases_hash): New function.
	(mips16_local_aliases_eq): Likewise.
	(mips16_local_alias): Likewise.
	(mips16_stub_function): Likewise.
	(mips16_build_function_stub): Create a local alias for the target
	function.  Handle TARGET_ABICALLS.  For PIC abicalls, emit a
	.cpload directive and an R_MIPS_NONE relocation for the target
	function, then load the alias rather than the function itself.
	Wrap the non-PIC abicalls version in ".option pic0/.option pic2".
	(mips16_copy_fpr_return_value): Use mips16_stub_function and
	mips_expand_call.  Set SYMBOL_REF_BIND_NOW on the symbol.
	(mips16_build_call_stub): Replace the FN parameter with an
	FN_PTR parameter.  Force the address into a register if it
	isn't a call_insn_operand; don't rely on the caller to do this.
	If a call to a locally-defined and locally-binding MIPS16
	function must be made indirectly, redirect the call to the
	function's local alias.  Use mips16_stub_function_p,
	mips16_stub_function, mips_expand_call and use_reg.
	Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols.
	Use explicit %hi and %lo accesses where possible.
	Use MIPS_CALL to generate the correct code form of a
	jal instruction.  Add clobbers of $18 instead of uses.
	Update the call to mips_emit_call_insn.
	(mips_expand_call): Replace the SIBCALL_P argument with a
	mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value.
	Take a LAZY_P parameter.  Call mips16_build_call_stub first,
	allowing it to modify the call address.  Update the calls to
	mips_load_call_address and mips_emit_call_insn.
	(mips_split_call): New function.
	(mips_init_relocs): Clear mips_split_hi_p.  Only use %gp_rel if
	!TARGET_MIPS16.  Split SYMBOL_GOT_DISP, and the high parts of
	SYMBOL_GOT_PAGE_OFST, for MIPS16 code.
	(mips_global_pointer): Check mips16_cfun_returns_in_fpr_p.
	(mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM
	if TARGET_MIPS16.
	(mips_cprestore_slot): New function.
	(mips_restore_gp): Take a TEMP parameter.  Handle TARGET_MIPS16
	and use mips_cprestore_slot.
	(mips_output_function_prologue): Handle TARGET_MIPS16 for
	LOADGP_OLDABI.
	(mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16,
	then use a copygp_mips16 instruction to set up $28.
	(mips_expand_prologue): Initialize the cprestore slot for MIPS16 too.
	(mips16_lay_out_constants): Call split_all_insns_noflow.
	(mips_reorg_process_insns): Explicitly set all_noreorder_p to
	false if TARGET_MIPS16.
	(mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16.
	(mips_output_mi_thunk): Use mips_got_symbol_type_p.  Use the
	mips_dangerous_for_la25_p approach for MIPS16 PIC calls too.
	(mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for
	MIPS16 code.  Allow MIPS16 o32 PIC.
	(mips_override_options): Allow MIPS16 o32 PIC.
	* config/mips/mips.md: Lower CONST_GP_P moves into register moves
	after reload if TARGET_USE_GOT.
	(UNSPEC_COPYGP): New constant.
	(length): Use a default length of 8 for MIPS16 GOT loads.
	(*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT.
	(*got_page<mode>): Check mips_split_hi_p.
	(*got_disp<mode>, *got_page<mode>): Use mips_got_load.
	(unspec_got<mode>, unspec_call<mode>): New expanders.
	(load_got<mode>, load_call<mode>): Remove the length attributes.
	Use a got attribute instead of a type attribute.
	(copygp_mips16): New insn.
	(restore_gp): Add a scratch clobber and pass it to mips_restore_gp.
	(load_call<mode>): Use a "d" constraint instead of an "r" constraint.
	(sibcall, sibcall_value, call, call_value): Update the calls
	to mips_expand_call.
	(call_internal, call_value_internal): Use mips_split_call.
	(call_value_multiple_internal): Likewise.
	(call_split): Move after call_internal (the insn it is split from).
	(call_internal_direct, call_value_internal_direct): Turn into
	define_insn_and_splits.  Split if TARGET_SPLIT_CALLS.
	(call_direct_split, call_value_direct_split): New patterns.
	* config/mips/constraints.md (c): Handle TARGET_MIPS16 first
	and use M16_REGS instead of M16_NA_REGS.
	* config/mips/predicates.md (const_call_insn_operand): Replace
	the TARGET_ABSOLUTE_ABICALLS-based check with a more general
	mips_use_pic_fn_addr_reg_p check.
	(move_operand): Reject HIGHs if mips_split_hi_p.
	* config/mips/mips16.S: Assembly as empty if the ABI is not suitable.
	(__mips16_floatunsisf): Inline __mips16_floatsisf.
	(CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25.
	* config/mips/libgcc-mips16.ver: New file.
	* config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add
	$(srcdir)/config/mips/libgcc-mips16.ver.

gcc/testsuite/
	* lib/target-supports.exp (check_profiling_available): Return false
	for -p and -pg on MIPS16 targets.

From-SVN: r138912
2008-08-09 19:08:15 +00:00
Richard Sandiford 7462a71535 mips.c (mips_unspec_address_offset): Move earlier in file.
gcc/
	* config/mips/mips.c (mips_unspec_address_offset): Move earlier in file.
	(mips_unspec_address, mips_unspec_offset_high): Likewise.
	(mips_ok_for_lazy_binding_p, mips_load_call_address): Likewise.
	(mips16_cfun_returns_in_fpr_p): Likewise.

From-SVN: r138911
2008-08-09 18:21:50 +00:00
Richard Sandiford b2b6160771 mips.h (FUNCTION_NAME_ALREADY_DECLARED): Delete.
gcc/
2008-08-09  Richard Sandiford  <rdsandiford@googlemail.com>
	    Daniel Jacobowitz  <dan@codesourcery.com>

	* config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Delete.
	* config/mips/linux.h (ASM_DECLARE_FUNCTION_NAME): Delete.
	(ASM_DECLARE_FUNCTION_SIZE, FUNCTION_NAME_ALREADY_DECLARED): Delete.
	* config/mips/mips.c (mips_start_function_definition): New function.
	(mips_end_function_definition): Likewise.
	(mips_output_function_prologue): Use mips_start_function_definition.
	(mips_output_function_epilogue): Use mips_end_function_definition.
	(build_mips16_function_stub): Use mips_start_function_definition
	and mips_end_function_definition.
	(build_mips16_call_stub): Likewise.

Co-Authored-By: Daniel Jacobowitz <dan@codesourcery.com>

From-SVN: r138908
2008-08-09 18:10:18 +00:00
Kaveh R. Ghazi 0a2aaaccca alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords.
* config/alpha/alpha.c (alpha_preferred_reload_class,
	alpha_secondary_reload, alpha_emit_set_const_1, function_value,
	alpha_output_mi_thunk_osf): Avoid C++ keywords.
	* config/arm/arm.c (output_move_vfp, output_move_neon): Likewise.
	* config/arm/arm.md: Likewise.
	* config/avr/avr-protos.h (preferred_reload_class,
	test_hard_reg_class, avr_simplify_comparison_p,
	out_shift_with_cnt, class_max_nregs): Likewise.
	* config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p,
	output_movqi, output_movhi, output_movsisf, out_shift_with_cnt,
	preferred_reload_class, test_hard_reg_class): Likewise.
	* config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok,
	bfin_memory_move_cost, bfin_secondary_reload,
	bfin_output_mi_thunk): Likewise.
	* config/crx/crx.c (crx_secondary_reload_class,
	crx_memory_move_cost): Likewise.
	* config/frv/frv-protos.h (frv_secondary_reload_class,
	frv_class_likely_spilled_p, frv_class_max_nregs): Likewise.
	* config/frv/frv.c (frv_override_options, frv_alloc_temp_reg,
	frv_secondary_reload_class, frv_class_likely_spilled_p,
	frv_class_max_nregs): Likewise.
	* config/h8300/h8300.c (h8300_classify_operand,
	h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count):
	Likewise.
	* config/i386/winnt.c (i386_pe_declare_function_type): Likewise.
	* config/ia64/ia64.c (ia64_preferred_reload_class,
	ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise.
	* config/iq2000/iq2000.c (gen_int_relational): Likewise.
	* config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare):
	Likewise.
	* config/m68hc11/m68hc11.c (preferred_reload_class,
	m68hc11_memory_move_cost): Likewise.
	* config/mcore/mcore.c (mcore_secondary_reload_class,
	mcore_reload_class): Likewise.
	* config/mips/mips.c (mips_hard_regno_mode_ok_p,
	mips_class_max_nregs, mips_cannot_change_mode_class,
	mips_preferred_reload_class, mips_secondary_reload_class,
	mips_output_mi_thunk): Likewise.
	* config/mmix/mmix.c (mmix_preferred_reload_class,
	mmix_preferred_output_reload_class, mmix_secondary_reload_class):
	Likewise.
	* config/mn10300/mn10300.c (mn10300_secondary_reload_class):
	Likewise.
	* config/pa/pa.c (pa_secondary_reload, pa_combine_instructions,
	pa_can_combine_p, pa_cannot_change_mode_class): Likewise.
	* config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise.
	* config/rs6000/rs6000.c (paired_expand_vector_init,
	rs6000_secondary_reload_class, rs6000_output_mi_thunk,
	compare_section_name, rs6000_memory_move_cost): Likewise.
	* config/s390/s390.c (s390_emit_compare_and_swap,
	s390_preferred_reload_class, s390_secondary_reload,
	legitimize_pic_address, legitimize_tls_address,
	legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic,
	s390_class_max_nregs): Likewise.
	* config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise.
	* config/s390/s390.md: Likewise.
	* config/score/score-protos.h (score_secondary_reload_class,
	score_preferred_reload_class): Likewise.
	* config/score/score.c (score_preferred_reload_class,
	score_secondary_reload_class): Likewise.
	* config/score/score3.c (score3_output_mi_thunk,
	score3_preferred_reload_class, score3_secondary_reload_class,
	score3_hard_regno_mode_ok): Likewise.
	* config/score/score3.h (score3_preferred_reload_class,
	score3_secondary_reload_class): Likewise.
	* config/score/score7.c (score7_output_mi_thunk,
	score7_preferred_reload_class, score7_secondary_reload_class,
	score7_hard_regno_mode_ok): Likewise.
	* config/score/score7.h (score7_preferred_reload_class,
	score7_secondary_reload_class): Likewise.
	* config/sh/sh.c (prepare_move_operands, output_far_jump,
	output_branchy_insn, add_constant, gen_block_redirect,
	sh_insn_length_adjustment, sh_cannot_change_mode_class,
	sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload):
	Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/stormy16/stormy16.c (xstormy16_output_cbranch_hi,
	xstormy16_output_cbranch_si, xstormy16_secondary_reload_class,
	xstormy16_preferred_reload_class): Likewise.
	* config/xtensa/xtensa.c (xtensa_expand_compare_and_swap,
	xtensa_expand_atomic, override_options,
	xtensa_preferred_reload_class, xtensa_secondary_reload_class):
	Likewise.
	* reorg.c (try_merge_delay_insns): Likewise.
	* tree.c (merge_dllimport_decl_attributes): Likewise.

	* config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA.

From-SVN: r138813
2008-08-06 16:12:51 +00:00
Adam Nemet f2d6ca5081 config.gcc (mipsisa64*-*-linux*): New configuration.
* config.gcc (mipsisa64*-*-linux*): New configuration.  Set ISA
	to MIPS64r2 for mipsisa64r2*.
	* config/mips/mips.h (GENERATE_MIPS16E): Update comment.
	(ISA_MIPS64R2): New macro.
	(TARGET_CPU_CPP_BUILTINS, MULTILIB_ISA_DEFAULT): Handle it.
	(ISA_HAS_64BIT_REGS, ISA_HAS_MUL3, ISA_HAS_FP_CONDMOVE,
	ISA_HAS_8CC, ISA_HAS_FP4, ISA_HAS_PAIRED_SINGLE,
	ISA_HAS_MADD_MSUB, ISA_HAS_NMADD4_NMSUB4, ISA_HAS_CLZ_CLO,
	ISA_HAS_ROR, ISA_HAS_PREFETCH, ISA_HAS_PREFETCHX, ISA_HAS_SEB_SEH,
	ISA_HAS_EXT_INS, ISA_HAS_MXHC1, ISA_HAS_HILO_INTERLOCKS,
	ISA_HAS_SYNCI, MIN_FPRS_PER_FMT): Return true for ISA_MIPS64R2.
	(MIPS_ISA_LEVEL_SPEC, ASM_SPEC, LINK_SPEC): Handle -mips64r2.
	(TARGET_LOONGSON_2E, TARGET_LOONGSON_2F, TARGET_LOONGSON_2EF):
	Move up to keep list alphabetically sorted.
	(TUNE_20KC, TUNE_24K, TUNE_74K, TUNE_LOONGSON_2EF): Likewise.
	* config/mips/mips.c (mips_cpu_info_table): Add default MIPS64r2
	processor.
	* doc/invoke.texi (MIPS Options): Add -mips64r2.
	(-march=@var{arch}): Add mips64r2.

testsuite/

	* gcc.target/mips/ext-1.c: New test.

From-SVN: r138448
2008-08-01 01:18:16 +00:00
Richard Biener 726a989a8b backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
2008-07-28  Richard Guenther  <rguenther@suse.de>

	Merge from gimple-tuples-branch.

	* ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
	* gimple.def: New file.
	* gsstruct.def: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* tree-gimple.c: Removed.  Merged into ...
	* gimple.c: ... here.  New file.
	* tree-gimple.h: Removed.  Merged into ...
	* gimple.h: ... here.  New file.

	* Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h.
	* configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the
	--enable-checking=gimple flag.
	* config.in: Likewise.
	* configure: Regenerated.

	* tree-ssa-operands.h: Tuplified.
	* tree-vrp.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-complex.c: Likewise.
	* cgraphbuild.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tracer.c: Likewise.
	* gengtype.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* value-prof.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-tailcall.c: Likewise.
	* value-prof.h: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* tree-pass.h: Likewise.
	* ipa-cp.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-scalar-evolution.h: Likewise.
	* target.h: Likewise.
	* lambda-mat.c: Likewise.
	* tree-phinodes.c: Likewise.
	* diagnostic.h: Likewise.
	* builtins.c: Likewise.
	* tree-ssa-alias-warnings.c: Likewise.
	* cfghooks.c: Likewise.
	* fold-const.c: Likewise.
	* cfghooks.h: Likewise.
	* omp-low.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* ipa-reference.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* toplev.c: Likewise.
	* tree-gimple.c: Likewise.
	* tree-gimple.h: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* cgraphunit.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* c-format.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* ipa-utils.c: Likewise.
	* tree-ssa-propagate.h: Likewise.
	* tree-ssa-alias.c: Likewise.
	* gimple-low.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* ipa-inline.c: Likewise.
	* c-semantics.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* predict.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* matrix-reorg.c: Likewise.
	* c-decl.c: Likewise.
	* tree-eh.c: Likewise.
	* c-pretty-print.c: Likewise.
	* lambda-trans.c: Likewise.
	* function.c: Likewise.
	* langhooks.c: Likewise.
	* ebitmap.h: Likewise.
	* tree-vectorizer.c: Likewise.
	* function.h: Likewise.
	* langhooks.h: Likewise.
	* tree-vectorizer.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* domwalk.c: Likewise.
	* tree-if-conv.c: Likewise.
	* profile.c: Likewise.
	* domwalk.h: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-affine.c: Likewise.
	* tree-vect-analyze.c: Likewise.
	* c-typeck.c: Likewise.
	* gimplify.c: Likewise.
	* coretypes.h: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* calls.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree.def: Likewise.
	* tree-dfa.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* cfgexpand.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-predcom.c: Likewise.
	* lambda.h: Likewise.
	* tree-mudflap.c: Likewise.
	* ipa-prop.c: Likewise.
	* print-tree.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* ipa-prop.h: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* ggc-page.c: Likewise.
	* c-omp.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-ssa.c: Likewise.
	* lambda-code.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-iterator.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-vect-transform.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* cfgloop.c: Likewise.
	* system.h: Likewise.
	* tree-profile.c: Likewise.
	* cfgloop.h: Likewise.
	* c-gimplify.c: Likewise.
	* c-common.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-flow.h: Likewise.
	* c-common.h: Likewise.
	* basic-block.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-ssa-structalias.h: Likewise.
	* tree-cfg.c: Likewise.
	* passes.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* cfgrtl.c: Likewise.
	* varpool.c: Likewise.
	* stmt.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* langhooks-def.h: Likewise.
	* tree-ssa-operands.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32c/m32c-protos.h: Likewise.
	* config/spu/spu.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/mips/mips.c: Likewise.

From-SVN: r138207
2008-07-28 14:33:56 +00:00
Richard Sandiford 2feaae2036 md.texi: Document the MIPS "v" constraint.
gcc/
	* doc/md.texi: Document the MIPS "v" constraint.
	* config/mips/mips.h (reg_class): Revert last change.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	* config/mips/mips.c (mips_regno_to_class): Likewise.
	* config/mips/constraints.md (v): Likewise, but add documentation.
	Add a comment to say that this constraint should not be used in
	gcc code.

From-SVN: r137734
2008-07-12 07:57:42 +00:00
Richard Sandiford 256f27f13c re PR target/35802 (MIPS64: Unable to find a register to spill in class &#8216;V1_REG&#8217;)
gcc/
	PR target/35802
	* config/mips/mips.h (reg_class): Remove V1_REG.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
	* config/mips/mips.c (mips_regno_to_class): Map $3 to M16_NA_REGS
	instead of V1_REGS.
	(mips_get_tp): New function.
	(mips_legitimize_tls_address): Use it.
	* config/mips/constraints.md (v): Delete.
	* config/mips/mips.md (TLS_GET_TP_REGNUM): New constant.
	(tls_get_tp_<mode>): Allow any GPR destination and clobber $3.
	After reload, split into a move and ...
	(*tls_get_tp_<mode>_split): ...this new instruction.

gcc/testsuite/
	PR target/35802
	* gcc.target/mips/pr35802.c: New test.

From-SVN: r137670
2008-07-09 20:03:40 +00:00
Richard Sandiford 60730adec0 mips.h (TARGET_CPU_CPP_BUILTINS): Check mips_base_mips16 instead of TARGET_MIPS16.
gcc/
	* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Check
	mips_base_mips16 instead of TARGET_MIPS16.
	(mips_base_mips16): Declare.
	* config/mips/mips.c (mips_base_mips16): Make global.
	(was_mips16_p): Remove GTY marker.
	(was_mips16_pch_p): New variable.
	(mips_set_mips16_mode): Check both was_mips16_p and was_mips16_pch_p.
	(mips_override_options): Force to non-MIPS16 mode initially.
	Do not complain about MIPS16 PIC incompatibilities here.
	Only allow -mgpopt if -mexplicit-relocs is in force for
	non-MIPS16 code.

gcc/testsuite/
	* gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Expect the
	macros to be defined for MIPS16 too.
	* gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise.
	* gcc.target/mips/gcc-have-sync-compare-and-swap-3.c: New test.
	* gcc.target/mips/gcc-have-sync-compare-and-swap-4.c: Likewise.

From-SVN: r137539
2008-07-06 20:38:37 +00:00
Richard Sandiford c5cb5d18b3 mips-protos.h (mips_split_const_insns): Declare.
gcc/
	* config/mips/mips-protos.h (mips_split_const_insns): Declare.
	* config/mips/mips.c (mips_split_const_insns): New function.
	* config/mips/mips.md (move_type): New attribute.
	(mode): Move attribute definition earlier in file.  Add "TI"
	and "TF".
	(dword_mode): New attribute.
	(type): Avoid long line.  Map "move_type"s to "type"s,
	choosing "multi" for doubleword moves if appropriate.
	Swap MTC/MFC comments to match their declaration order.
	(extended_mips16): Default to "yes" if "move_type" is "sll0",
	"type" is "branch" or "jal" is "direct".
	(length): Handle "extended_mips16" first.  Make the default
	"0" for "ghost" instructions.  Set the length from "move_type".
	(truncdisi2, truncdihi2, truncdiqi2): Use "move_type" instead
	of "type", with "sll0" for the register alternative.  Remove the
	"extended_mips16" attribute.
	(zero_extendsidi2, *clear_upper32): Use "move_type" instead
	of "type", with "shift_shift" for the register alternative.
	Remove the "length" attribute.
	(*extend<SHORT:mode><GPR:mode>2, *extendqihi2): Likewise.
	(*zero_extend<SHORT:mode><GPR:mode>2): Use "move_type" instead
	of "type", with "andi" for the register alternative.
	(*zero_extendqihi2): Likewise.
	(*zero_extend<SHORT:mode><GPR:mode>2_mips16e): Use a "move_type"
	of "andi" instead of a "type" of "arith".
	(*zero_extend<SHORT:mode><GPR:mode>2_mips16): Use "move_type"
	instead of "type".
	(*zero_extendqihi2_mips16, mov_<load>l, mov_<load>r, mov_<store>l)
	(mov_<store>r, *mov<mode>_ra): Likewise.
	(extendsidi2): Use "move_type" instead of "type", with "move"
	for the register alternative.
	(*extend<SHORT:mode><GPR:mode>2_mips16e): Use "move_type" instead
	of "type", with "signext" for the register alternative.
	(*extend<SHORT:mode><GPR:mode>2_se<SHORT:size>): Likewise.
	(*extendqihi2_mips16e, *extendqihi2_seb): Likewise.
	(fix_truncdfsi2_insn, fix_truncsfsi2_insn, fix_truncdfdi2)
	(fix_truncsfdi2, floatsidf2, floatdidf2, floatsisf2, floatdisf2)
	(floatdisf2, *branch_equality<mode>_mips16): Likewise.
	(unnamed branch insn): Likewise.
	(*movdi_gp32_fp64): Fold into...
	(*movdi_32bit): ...here.
	(*movdf_hardfloat_64bit, *movdf_hardfloat_32bit): Combine into...
	(*movdf_hardfloat): ...this new pattern.
	(*movdf_softfloat): Remove redundant FPR alternatives.
	(*movti, *movti_mips16, *movtf, *movtf_mips16): Add "mode" attributes.
	(*movv2sf_hardfloat_64bit, *movv2sf_hardfloat_32bit): Combine into...
	(*movv2sf): ...this new pattern.  Use "DF" rather than "SF" for
	the "move" attribute.
	(*movdi_32bit): Use "move_type" instead of "type" and remove the
	"length" attribute.  Use "fpload" and "fpstore" instead of "load"
	and "store" for COP loads and stores.
	(*movdi_32bit_mips16, *movdi_64bit, *movsi_internal, movcc)
	(*movhi_internal, *movhi_mips16, *movqi_internal, *movqi_mips16)
	(*movsf_hardfloat, *movsf_softfloat, *movsi_mips16, *movdf_hardfloat)
	(*movdf_softfloat, *movdf_mips16, *movti, *movti_mips16, *movtf)
	(*movtf_mips16, *movv2sf): Likewise.
	(mfhi<GPR:mode>_<HILO:mode>, mflo<GPR:mode>_<HILO:mode>)
	(load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>)
	(mfhc1<mode>): Use "move_type" instead of "move".
	(*low<mode>_mips16): Use "extended_mips16" instead of "length".
	(loadgp_blockage): Remove the "length" attribute.
	(blockage, set_got_version, update_got_version): Likewise.
	(call_internal): Remove the "extended_mips16" attribute.
	(call_value_internal, call_value_multiple_internal): Likewise.
	* config/mips/loongson.md (mov<mode>_internal): Use "move_type"
	instead of "move".
	* config/mips/mips-dsp.md (mips_lbux, mips_lhx, mips_lwx): Remove
	the "length" attribute.

From-SVN: r137194
2008-06-27 17:20:32 +00:00
Kaveh R. Ghazi 5ead67f603 c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings.
* c-format.c (handle_format_attribute): Fix -Wc++-compat and/or
	-Wcast-qual warnings.
	* c-pragma.c (dpm_eq, handle_pragma_push_macro,
	handle_pragma_pop_macro): Likewise.
	* collect2.c (resolve_lib_name): Likewise.
	* config/arc/arc.c (arc_init): Likewise.
	* config/arm/arm.c (neon_builtin_compare,
	locate_neon_builtin_icode): Likewise.
	* config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section):
	Likewise.
	* config/bfin/bfin.c (bfin_init_machine_status,
	bfin_optimize_loop): Likewise.
	* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise.
	* config/cris/cris.c (cris_init_expanders): Likewise.
	* config/darwin-c.c (frameworks_in_use, add_framework): Likewise.
	* config/darwin.c (machopic_indirection_eq,
	machopic_indirection_name, machopic_output_indirection):
	Likewise.
	* config/frv/frv.c (frv_init_machine_status, frv_compare_insns,
	frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1,
	frv_optimize_membar): Likewise.
	* config/i386/cygwin.h (mingw_scan,
	GCC_DRIVER_HOST_INITIALIZATION): Likewise.
	* config/i386/cygwin1.c (mingw_scan): Likewise.
	* config/i386/i386.c (machopic_output_stub): Likewise.
	* config/i386/winnt.c (gen_stdcall_or_fastcall_suffix,
	i386_pe_unique_section): Likewise.
	* config/ia64/ia64.c (ia64_init_machine_status,
	ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg):
	Likewise.
	* config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise.
	* config/m68k/m68k.c (m68k_handle_option,
	m68k_sched_md_init_global): Likewise.
	* config/mcore/mcore.c (mcore_mark_dllexport,
	mcore_mark_dllimport, mcore_unique_section): Likewise.
	* config/mips/mips.c (mips_block_move_straight,
	mips16_rewrite_pool_refs, mips_sim_wait_regs_2,
	mips_sim_record_set): Likewise.
	* config/mmix/mmix.c (mmix_init_machine_status,
	mmix_encode_section_info): Likewise.
	* config/pa/pa.c (pa_init_machine_status, hppa_encode_label):
	Likewise.
	* config/rs6000/rs6000.c (rs6000_init_machine_status,
	print_operand_address, output_toc, redefine_groups,
	rs6000_elf_encode_section_info, machopic_output_stub): Likewise.
	* config/s390/s390.c (s390_init_machine_status): Likewise.
	* config/score/score.c (score_block_move_straight,
	score_block_move_loop_body): Likewise.
	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
	* emit-rtl.c (find_auto_inc): Likewise.
	* gcc.c (translate_options, process_command): Likewise.
	* reorg.c (dbr_schedule): Likewise.
	* sdbout.c (sdbout_start_source_file, sdbout_init): Likewise.
	* xcoffout.c (xcoffout_declare_function): Likewise.

From-SVN: r137191
2008-06-27 16:53:54 +00:00
Richard Sandiford e2ff10a93c libfuncs.h (LTI_synchronize): New libfunc_index.
gcc/
	* libfuncs.h (LTI_synchronize): New libfunc_index.
	(synchronize_libfunc): Declare.
	* builtins.c (expand_builtin_synchronize): Consider using
	synchronize_libfunc before falling back on an asm blockage.
	* config/mips/mips.c: Include libfuncs.h
	(mips_init_libfuncs): Initialize synchronize_libfunc for TARGET_MIPS16.

From-SVN: r137162
2008-06-26 21:28:30 +00:00
Maxim Kuvyrkov b51469a5d8 mips.h (ISA_HAS_CONDMOVE): Slice ISA_HAS_FP_CONDMOVE from it.
* config/mips/mips.h (ISA_HAS_CONDMOVE): Slice ISA_HAS_FP_CONDMOVE
	from it.
	(ISA_HAS_FP_CONDMOVE): New macro.
	(ISA_HAS_FP_MADD4_MSUB4, ISA_HAS_FP_MADD3_MSUB3): New macros.
	(ISA_HAS_NMADD_NMSUB): Rename to ISA_HAS_NMADD4_NMSUB4.
	(ISA_HAS_NMADD3_NMSUB3): New macro.
	* config/mips/mips.c (mips_rtx_costs): Update.
	* config/mips/mips.md (MOVECC): Don't use FP conditional moves when
	compiling for ST Loongson 2E/2F.
	(madd<mode>): Rename to madd4<mode>.  Update.
	(madd3<mode>): New pattern.
	(msub<mode>): Rename to msub4<mode>.  Update.
	(msub3<mode>): New pattern.
	(nmadd<mode>): Rename to nmadd4<mode>.  Update.
	(nmadd3<mode>): New pattern.
	(nmadd<mode>_fastmath): Rename to nmadd4<mode>_fastmath.  Update.
	(nmadd3<mode>_fastmath): New pattern.
	(nmsub<mode>): Rename to nmsub4<mode>.  Update.
	(nmsub3<mode>): New pattern.
	(nmsub<mode>_fastmath): Rename to nmsub4<mode>_fastmath.  Update.
	(nmsub3<mode>_fastmath): New pattern.
	(mov<SCALARF:mode>_on_<MOVECC:mode>, mov<mode>cc): Update.

From-SVN: r136887
2008-06-18 07:39:45 +00:00
Maxim Kuvyrkov 58684fa02e loongson2ef.md: New file.
* config/mips/loongson2ef.md: New file.
	* config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN)
	(UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN)
	(UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN)
	(UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants.
	(define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e
	and loongson_2f.
	(loongson2ef.md): New include.
	* config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>)
	(add<mode>3, paddd, ssadd<mode>3, usadd<mode>3)
	(loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>)
	(loongson_gt_<mode>, loongson_extract_halfword)
	(loongson_insert_halfword_0, loongson_insert_halfword_2)
	(loongson_insert_halfword_3, loongson_mult_add, smax<mode>3)
	(umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask)
	(umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart)
	(loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>)
	(loongson_psadbh, loongson_pshufh, loongson_psll<mode>)
	(loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd)
	(sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>)
	(vec_interleave_low<mode>): Define type attribute.
	* config/mips/mips.c (mips_ls2): New static variable.
	(mips_issue_rate): Update to handle tuning for Loongson 2E/2F.
	(mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn)
	(sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle):
	Implement target scheduling hooks.
	(mips_multipass_dfa_lookahead): Update to handle tuning for
	Loongson 2E/2F.
	(mips_sched_init): Initialize data for Loongson scheduling.
	(mips_ls2_variable_issue): New static function.
	(mips_variable_issue): Update to handle tuning for Loongson 2E/2F.
	Add sanity check.
	(TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN)
	(TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks.
	* config/mips/mips.h (TUNE_LOONGSON_2EF): New macros.
	(ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS):
	Handle ST Loongson 2E/2F cores.
	(CPU_UNITS_QUERY): Define macro to enable querying of DFA units.

From-SVN: r136805
2008-06-15 10:03:07 +00:00
Mark Shinwell 93581857e5 mips-modes.def: Add V8QI, V4HI and V2SI modes.
2008-06-15  Mark Shinwell  <shinwell@codesourcery.com>
	    Nathan Sidwell  <nathan@codesourcery.com>
	    Maxim Kuvyrkov  <maxim@codesourcery.com>
	    Richard Sandiford  <rdsandiford@googlemail.com>
	
	* config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes.
	* config/mips/mips-protos.h (mips_expand_vector_init): New.
	* config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F
	builtins.
	* config/mips/mips.c (mips_split_doubleword_move): Handle new modes.
	(mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson.
	(mips_vector_mode_supported_p): Add V2SImode, V4HImode and
	V8QImode cases.
	(LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New.
	(CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb,
	(CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw,
	(CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb,
	(CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb)
	(CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb)
	(CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub)
	(CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub)
	(CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh)
	(CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw)
	(CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb)
	(CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb)
	(CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb)
	(CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw)
	(CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh)
	(CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New.
	(mips_builtins): Add Loongson builtins.
	(mips_loongson_2ef_bdesc): New.
	(mips_bdesc_arrays): Add mips_loongson_2ef_bdesc.
	(mips_builtin_vector_type): Handle unsigned versions of vector modes.
	(MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI)
	(MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI):
	New.
	(mips_expand_vector_init): New.
	* config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New.
	(TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev
	if appropriate.
	* config/mips/mips.md: Add unspec numbers for Loongson
	builtins.  Include loongson.md.
	(MOVE64): Include Loongson vector modes.
	(SPLITF): Include Loongson vector modes.
	(HALFMODE): Handle Loongson vector modes.
	* config/mips/loongson.md: New.
	* config/mips/loongson.h: New.
	* config.gcc: Add loongson.h header for mips*-*-* targets.
	* doc/extend.texi (MIPS Loongson Built-in Functions): New.

2008-06-15  Mark Shinwell  <shinwell@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_mips_loongson): New.
	* gcc.target/mips/loongson-simd.c: New.

Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>

From-SVN: r136800
2008-06-15 06:29:06 +00:00
Richard Sandiford fd0eb89726 mips.c (BUILTIN_AVAIL_NON_MIPS16): New macro.
gcc/
	* config/mips/mips.c (BUILTIN_AVAIL_NON_MIPS16): New macro.
	(AVAIL_NON_MIPS16): Likewise.
	(mips_builtin_description): Replace target_flags with a predicate.
	(paired_single, sb1_paired_single, mips3d, dsp, dspr2, dsp_32)
	(dspr2_32): New availability predicates.
	(MIPS_BUILTIN): New macro.
	(DIRECT_BUILTIN, CMP_SCALAR_BUILTINS, CMP_PS_BUILTINS)
	(CMP_4S_BUILTINS, MOVTF_BUILTINS, CMP_BUILTINS)
	(DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): Use it.
	Replace the TARGET_FLAGS parameters with AVAIL parameters.
	(mips_ps_bdesc, mips_sb1_bdesc, mips_dsp_bdesc)
	(mips_dsp_32only_bdesc): Merge into...
	(mips_builtins): ...this new array.
	(mips_bdesc_map, mips_bdesc_arrays): Delete.
	(mips_init_builtins): Update after above changes.
	(mips_expand_builtin_1): Merge into...
	(mips_expand_builtin): ...here and update after above changes.

From-SVN: r136738
2008-06-13 06:56:31 +00:00
Richard Sandiford 21dfc6dc74 md.texi: Synchronize with later constraints.md change.
gcc/
	* doc/md.texi: Synchronize with later constraints.md change.
	* longlong.h (umul_ppmm): Replace the MIPS asm implementation
	with a C implementation.
	* config/mips/mips.c (mips_legitimize_move): Remove MFHI and
	MFLO handling.
	(mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT.
	(mips_split_doubleword_move): Use special MTHI and MFHI instructions
	when moving to and from MD_REGNUM.
	(mips_output_move): Don't handle moves from GPRs to HI_REGNUM.
	Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC.
	Handle byte and halfword moves.
	(mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS
	separately.
	* config/mips/constraints.md (h): Turn into NO_REGS.
	(l, x): Update documentation.
	* config/mips/mips.md (UNSPEC_MFHILO): Delete.
	(UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New.
	(UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber.
	(HILO): New mode iterator.
	(MOVE128): Add TI.
	(any_div): New code iterator.
	(u): Extend code attribute to div and udiv.
	(*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use
	d_operand in the splitters.  Remove redundant CONST_INT checks.
	(mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si)
	(*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si)
	(*muls): Remove "=h" clobbers.  Adjust peephole2s and define_splits
	accordingly, using normal moves instead of unspecs to move LO into
	a GPR.  Use d_operand and lo_operand instead of *_REG_P checks.
	(<u>mulsidi3): Handle expansion in C code.
	(<u>mulsidi3_32bit_internal): Rename to...
	(<u>mulsidi3_32bit): ...this.
	(<u>mulsidi3_32bit_r4000): Fix insn separator.
	(*<u>mulsidi3_64bit): Rename to...
	(<u>mulsidi3_64bit): ...this.  Combine DImode "=h" and "=l" clobbers
	into a TImode "=x" clobber.  In the split, use an UNSPEC_SET_HILO
	to set LO and HI to the multiplication result.  Use a normal move
	for MFLO and an unspec for MFHI.
	(*<u>mulsidi3_64bit_parts): Replace with...
	(<u>mulsidi3_64bit_hilo): ...this new instruction.
	(<su>mulsi3_highpart): Extend to TARGET_FIX_R4000.
	(<su>mulsi3_highpart_internal): Turn into a define_insn_and_split
	and extend it to TARGET_FIX_R4000.  Store the destination in a GPR
	instead of HI.  Split the instruction into a separate multiplication
	and MFHI if !TARGET_FIX_R4000.
	(<su>muldi3_highpart): Likewise.
	(<su>mulsi3_highpart_mulhi_internal): Remove the first alternative
	and the "=h" clobber.
	(*<su>mulsi3_highpart_neg_mulhi_internal): Likewise.
	(<u>mulditi3): New expander.
	(<u>mulditi3_internal, <u>mulditi3_r4000): New patterns.
	(madsi): Remove "=h" clobber.
	(divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits.
	Force the modulus result to be a GPR and split the instruction into
	a division followed by an MFHI after reload.
	(<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction.
	(*lea_high64): Use d_operand in the define_peephole2.  Likewise
	the MIPS16 HIGH define_split.
	(*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type
	of acc<->gpr moves to "multi".
	(*movdi_64bit): Replace the single "x" alternative with
	alternatives for moving into and out of "a".
	(*movhi_internal, *movqi_internal): Likewise.  Use mips_output_move.
	(*movsi_internal): Extend the "d<-A" alternative to "d<-a".
	(*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives.
	Use d_operand in the splitters.  Remove redundant CONST_INT checks.
	(*movhi_mips16, *movqi_mips16): Likewise.  Use mips_output_move.
	(movti): New expander.
	(*movti, *movti_mips16): New insns.
	(mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete.
	(mfhi<GPR:mode>_<HILO:mode>): New pattern.
	(mthi<GPR:mode>_<HILO:mode>): Likewise.
	* config/mips/predicates.md (fpr_operand): Delete.
	(d_operand): New predicate.

gcc/testsuite/
	* gcc.dg/torture/mips-hilo-1.c: Delete.
	* gcc.target/mips/pr35232.c: Likewise.
	* gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi.
	* gcc.target/mips/fix-vr4130-3.c: Likewise.
	* gcc.target/mips/int-moves-1.c: New test.
	* gcc.target/mips/int-moves-2.c: Likewise.
	* gcc.target/mips/fix-r4000-1.c: Likewise.
	* gcc.target/mips/fix-r4000-2.c: Likewise.
	* gcc.target/mips/fix-r4000-3.c: Likewise.
	* gcc.target/mips/fix-r4000-4.c: Likewise.
	* gcc.target/mips/fix-r4000-5.c: Likewise.
	* gcc.target/mips/fix-r4000-6.c: Likewise.
	* gcc.target/mips/fix-r4000-7.c: Likewise.
	* gcc.target/mips/fix-r4000-8.c: Likewise.
	* gcc.target/mips/fix-r4000-9.c: Likewise.
	* gcc.target/mips/fix-r4000-10.c: Likewise.
	* gcc.target/mips/fix-r4000-11.c: Likewise.
	* gcc.target/mips/fix-r4000-12.c: Likewise.
	* gcc.target/mips/timode-1.c: Likewise.
	* gcc.target/mips/timode-2.c: Likewise.

From-SVN: r136600
2008-06-09 20:45:56 +00:00
Sandip Matte d0ae31b09e invoke.texi: Document -march=xlr.
gcc/
2008-06-05  Sandip Matte  <sandip@rmicorp.com>

	* doc/invoke.texi: Document -march=xlr.
	* config/mips/xlr.md: New file.
	* config/mips/mips.md: Include it.
	(cpu): Add "xlr".
	* config/mips/mips.h (PROCESSOR_XLR): New processor_type.
	* config/mips/mips.c (mips_cpu_info_table): Add an XLR entry.
	(mips_rtx_cost_data): Likewise.

From-SVN: r136438
2008-06-06 14:24:57 +00:00
Richard Sandiford de9f679dbe mips.c (mips_emit_loadgp): Return early if there is nothing do to...
gcc/
	* config/mips/mips.c (mips_emit_loadgp): Return early if
	there is nothing do to, otherwise emit a blockage if
	!TARGET_EXPLICIT_RELOCS || crtl->profile.
	* config/mips/mips.md (loadgp_blockage): Use SI rather than DI.

From-SVN: r136294
2008-06-02 21:13:20 +00:00
Richard Sandiford fa21a761a6 mips.c (mips_valid_offset_p): New function.
gcc/
	* config/mips/mips.c (mips_valid_offset_p): New function.
	(mips_valid_lo_sum_p): Likewise.
	(mips_classify_address): Use them.
	(mips_force_address): New function.
	(mips_legitimize_address): Use it.
	* config/mips/mips.md (MOVE128): New mode iterator.
	(movtf): Require TARGET_64BIT.  Remove empty strings.
	(*movtf_internal): Rename to...
	(*movtf): ...this and require !TARGET_MIPS16.  Use "m" instead
	of "R" and use {,fp}{load,store} attributes instead of "multi".
	Use a separate define_split.
	(*movtf_mips16): New pattern.

gcc/testsuite/
	* gcc.target/mips/fpr-moves-7.c: New test.
	* gcc.target/mips/fpr-moves-8.c: New test.

From-SVN: r136253
2008-06-01 13:01:23 +00:00
Richard Sandiford 2f7e2abbd1 mips-protos.h (mips_expand_before_return): Declare.
gcc/
	* config/mips/mips-protos.h (mips_expand_before_return): Declare.
	* config/mips/mips.c (mips_expand_before_return): New function.
	(mips_expand_epilogue): Call it.
	* config/mips/mips.md (return): Turn into a define_expand.
	(*return): New insn.

From-SVN: r136252
2008-06-01 10:01:51 +00:00
Mark Shinwell 33db2060b0 mips.c (mips_cpu_info_table): Add loongson2e and loongson2f entries.
2008-05-28  Mark Shinwell  <shinwell@codesourcery.com>

	* config/mips/mips.c (mips_cpu_info_table): Add loongson2e
	and loongson2f entries.
	(mips_rtx_cost_data): Add entries for Loongson-2E/2F.
	* config/mips/mips.h (processor_type): Add Loongson-2E
	and Loongson-2F entries.
	(TARGET_LOONGSON_2E, TARGET_LOONGSON_2F, TARGET_LOONGSON_2EF): New.
	(MIPS_ISA_LEVEL_SPEC): Handle Loongson-2E/2F.
	* config/mips/mips.md (define_attr cpu): Add loongson2e and loongson2f.
	* doc/invoke.texi (MIPS Options): Document loongson2e
	and loongson2f processor names.

From-SVN: r136071
2008-05-28 10:33:39 +00:00
David Daney 06d1961718 mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants.
2008-05-20  David Daney  <ddaney@avtrex.com>

	* config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12,
	UNSPEC_SYNC_OLD_OP_12,
	UNSPEC_SYNC_EXCHANGE_12): New define_constants.
	(UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER,
	UNSPEC_SET_GOT_VERSION,
	UNSPEC_UPDATE_GOT_VERSION): Renumber.
	(optab, insn): Add 'plus' and 'minus' to define_code_attr.
	(atomic_hiqi_op): New define_code_iterator.
	(sync_compare_and_swap<mode>): Call
	mips_expand_atomic_qihi instead of
	mips_expand_compare_and_swap_12.
	(compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of
	MIPS_COMPARE_AND_SWAP_12_0.  Pass argument to
	MIPS_COMPARE_AND_SWAP_12.
	(sync_<optab><mode>, sync_old_<optab><mode>,
	sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>,
	sync_new_nand<mode>): New define_expands for HI and QI mode
	operands.
	(sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12,
	sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns.
	(sync_lock_test_and_set<mode>): New define_expand for HI and QI
	modes.
	(test_and_set_12): New insn.
	(sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>,
	sync_new_<optab><mode>, sync_old_nand<mode>,
	sync_new_nand<mode>, sync_lock_test_and_set<mode>):  Add early
	clobber to operand 0 for SI and DI mode insns.
	* config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5,
	mips_gen_fn_4): New typedefs.
	(mips_gen_fn_ptrs): Define new union type.
	(mips_expand_compare_and_swap_12): Remove declaration.
	(mips_expand_atomic_qihi): Declare function.
	* config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to...
	(mips_expand_atomic_qihi): ... this.  Use new generator function
	parameter.
	* config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter.
	(MIPS_COMPARE_AND_SWAP_12_0): Delete macro.
	(MIPS_COMPARE_AND_SWAP_12_ZERO_OP,
	MIPS_COMPARE_AND_SWAP_12_NONZERO_OP,
	MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP,
	MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12,
	MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG,
	MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG,
	MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP,
	MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12,
	MIPS_SYNC_EXCHANGE_12_ZERO_OP,
	MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros.

From-SVN: r135684
2008-05-20 23:13:13 +00:00
David Daney 977502ff84 target-supports.exp (check_effective_target_sync_int_long): Add mips*-*-*.
2008-05-08  David Daney  <ddaney@avtrex.com>

	* lib/target-supports.exp (check_effective_target_sync_int_long): Add
	mips*-*-*.
	(check_effective_target_sync_char_short): Same.


2008-05-08  David Daney  <ddaney@avtrex.com>
	    Richard Sandiford  <rsandifo@nildram.co.uk>
	
	* config/mips/mips.md (mips_expand_compare_and_swap_12): Handle
	special case of constant zero operands.
	* config/mips/mips.c (mips_expand_compare_and_swap_12): Zero extend
	old and	new values.  Special case constant zero values.
	* config/mips/mips.h (MIPS_COMPARE_AND_SWAP): Skip 'sync' if compare
	fails.
	(MIPS_COMPARE_AND_SWAP_12): Handle constant zero operands.
	(MIPS_COMPARE_AND_SWAP_12_0): New macro.


Co-Authored-By: Richard Sandiford <rsandifo@nildram.co.uk>

From-SVN: r135088
2008-05-08 17:04:12 +00:00
Kenneth Zadeck becfd6e57b [multiple changes]
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

        PATCH rtl/7335
        PATCH rtl/33826
        * see.c (see_copy_insn): Copy new pure const attributes for new
        call.
        * c-decl.c (merge_decls): Ditto.
        * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P
        to RTL_CONST_OR_PURE_CALL_P.
        * tree.c (define_local_buitin): Rename DECL_IS_PURE to
        DECL_PURE_P.  Initialized DECL_LOOPING_CONST_PURE.
        (process_call_operands): Set tree_side_effects properly.
        * tree.h (TREE_READONLY_DECL_P): Removed.
        (DECL_IS_PURE): Renamed to DECL_PURE_P.
        (DECL_LOOPING_OR_CONST_P): New macro.
        (struct tree_function_decl): Added looping_const_or_pure_p.
        (ECF_*) Renumbered.
        (ECF_LOOPING_OR_CONST_P): New macro,
        * rtlanal.c (pure_const_p): Removed.
        * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P.
        * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P
        to RTL_CONST_CALL_P.
        * ipa-pure-const.c (pure_const_state_e): Added looping field.
        (check_decl, check_tree, check_call, scan_function): Initialize
        looping.
        (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P.
        (static_execute): Set looping true for recursive functions.
        Undo setting state to IPA_NEITHER for recursive functions.
        * cse.c (cse_insn): 
        * ifcvt.c (noce_can_store_speculate_p): Changed
        CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or 
        RTL_CONST_OR_PURE_CALL_P.
        * dse.c (scan_insn): Ditto.
        * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto.
        * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and
        pure_call_p to RTL_CONST_CALL_P.
        * gimplify.c (gimplify_call_expr): Clear side effects for
        non-looping pure and constant calls.
        * calls.c (emit_call_1): Set rtl flags from ecf flags.
        (flags_from_decl_or_type): Set ecf flags from decl flags.
        (initialize_argument_information): Turn off
        ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST.
        Change const to pure if callee_copies is true rather than just
        turning off const.
        (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old
        way of marking pure calls.
        (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL.
        Remove hack that was supposed to fix pr7335 and remove old
        way of marking pure calls.
        * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P,
        RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P.
        * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        * tree-ssa-pre.c (can_value_number_call): Fixed spacing.
        * loop-invariant.c (find_exits, find_invariant_bb): Changed
        CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P.
        * sched-deps.c (schedule_analyze): Ditto.
        * rtl.h (struct rtx_def): Use call field, unchanging field, and
        return_val field of calls to represent pure and const function
        info.
        (CONST_OR_PURE_CALL_P): Deleted macro.
        (RTL_CONST_CALL_P, RTL_PURE_CALL_P,
        RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros.
        * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to
        TREE_READONLY.
        * tree-optimize.c (execute_fixup_cfg): Added test for
        ECF_LOOPING_CONST_OR_PURE.
        * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to
        DECL_PURE_P.
        * tree-cfg.c (update_call_expr_flags): Do not clear tree side
        effects for looping pure or const calls.
        (verify_gimple_expr): Added verification code. 
        * config/alpha/alpha.c (alpha_legitimize_address,
        alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_CALL_P.
        * config/s390/s390.c (s390_emit_tls_call_insn): Ditto.
        * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto.
        * config/mips/mips.c (mips_call_tls_get_addr): Ditto.
        * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to
        RTL_CONST_OR_PURE_CALL_P.
        * dce.c (deletable_insn_p): Allow non looping, non sibling, pure
        and const calls to be deleted.

java:
2008-05-07  Kenneth Zadeck <zadeck@naturalbridge.com>

	* decl.c (java_init_decl_processing): Change DECL_IS_PURE to
	DECL_PURE_P.

cp:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

	 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
	 DECL_LOOPING_CONST_OR_PURE_P attributes.
	 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
	 DECL_PURE_P.

gfortran:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>

	 * trans-decl.c (gfc_get_extern_function_decl, build_function_decl):
	 Rename DECL_IS_PURE to DECL_PURE_P.

From-SVN: r135053
2008-05-07 20:48:07 +00:00
Richard Sandiford 49bce30a21 mips.md (UNSPEC_COMPARE_AND_SWAP_12): New unspec_volitile.
gcc/
2008-04-23  David Daney  <ddaney@avtrex.com>

	* config/mips/mips.md (UNSPEC_COMPARE_AND_SWAP_12): New
	unspec_volitile.
	(UNSPEC_SYNC_OLD_OP, UNSPEC_SYNC_NEW_OP, UNSPEC_SYNC_EXCHANGE,
	UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION,
	UNSPEC_UPDATE_GOT_VERSION): Renumber.
	(sync_compare_and_swap<mode>): New expand for QI and HI modes.
	(compare_and_swap_12): New insn.
	* config/mips/mips-protos.h (mips_expand_compare_and_swap_12): Declare.
	* config/mips/mips.c (mips_force_binary): New function.
	(mips_emit_int_order_test, mips_expand_synci_loop): Use it.
	(mips_expand_compare_and_swap_12): New function.
	* config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): New macro.

gcc/testsuite/
	* gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Expect
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 and
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 to be defined.
	* gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise.

From-SVN: r134695
2008-04-26 07:40:04 +00:00
Jan Hubicka e3b5732b21 re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore)
PR testsuite/35843
	* cfgexpand.c (pass_expand): Turn into RTL pass.
	* passes.c (execute_one_pass): Do pass typechecking after execution.
	* tree-pass.h (pass_expand): Turn into RTL pass.

	* function.h (struct rtl_data): Move here fields
	accesses_prior_frames, calls_eh_return, saves_all_registers,
	has_nonlocal_goto, has_asm_statement, is_thunk,
	all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool,
	uses_pic_offset_table, uses_eh_lsda, tail_call_emit,
	arg_pointer_save_area_init from struct function; turn into bool.
	(struct function): Move
	calls_eh_return, saves_all_registers, has_nonlocal_goto,
	has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack,
	profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda,
	tail_call_emit, arg_pointer_save_area_init
	into struct rtl_data.  Remove recursive_call_emit and gimplified flags.
	(current_function_returns_struct, current_function_returns_pcc_struct,
	current_function_calls_setjmp, current_function_calls_alloca,
	current_function_accesses_prior_frames,
	current_function_calls_eh_return, current_function_is_thunk,
	current_function_stdarg, current_function_profile,
	current_function_limit_stack, current_function_uses_pic_offset_table,
	current_function_uses_const_pool, current_function_has_nonlocal_label,
	current_function_saves_all_registers,
	current_function_has_nonlocal_goto,
	current_function_has_asm_statement): Remove accesor macros.
	* ra-conflict.c (global_conflicts): Update.
	* tree-tailcall.c (suitable_for_tail_opt_p): Update.
	(suitable_for_tail_call_opt_p): Update.
	* builtins.c (expand_builtin_return_addr): Update.
	(expand_builtin_setjmp_setup): Update.
	(expand_builtin_nonlocal_goto): Update.
	* final.c (final_start_function): Update.
	(profile_function): Update.
	(leaf_function_p): Update.
	(only_leaf_regs_used): Update.
	* df-scan.c (df_get_exit_block_use_set): Update.
	* dojump.c (clear_pending_stack_adjust): Update.
	* tree-stdarg.c (gate_optimize_stdarg): Update.
	* gimple-low.c (lower_function_body): Update.
	* global.c (compute_regsets): Update.
	(global_alloc): Update.
	* dwarf2out.c (dwarf2out_begin_prologue): Update.
	* expr.c (expand_assignment): Update.
	* dse.c (dse_step0): Update.
	(dse_step1): Update.
	* c-decl.c (store_parm_decls): Update.
	* local-alloc.c (combine_regs): Update.
	(find_free_reg): Update.
	* function.c (assign_parms_augmented_arg_list): Update.
	(assign_parm_find_data_types): Update.
	(assign_parms): Update.
	(allocate_struct_function): Update.
	(expand_function_start): Update.
	(expand_function_end): Update.
	(get_arg_pointer_save_area): Update.
	(thread_prologue_and_epilogue_insns): Update.
	(rest_of_match_asm_constraints): Update.
	* stor-layout.c (variable_size): Update.
	* gcse.c (gcse_main): Update.
	(bypass_jumps): Update.
	* gimplify.c (gimplify_function_tree): Update.
	* calls.c (emit_call_1): Update.
	(expand_call): Update.
	* bt-load.c (compute_defs_uses_and_gen): Update.
	* except.c (sjlj_assign_call_site_values): Update.
	(sjlj_emit_function_enter): Update.
	(can_throw_external): Update.
	(set_nothrow_function_flags): Update.
	(expand_builtin_unwind_init): Update.
	(expand_eh_return): Update.
	(convert_to_eh_region_ranges): Update.
	(output_function_exception_table): Update.
	* emit-rtl.c (gen_tmp_stack_mem): Update.
	* cfgexpand.c (expand_used_vars): Update.
	(tree_expand_cfg): Update.
	* cfgcleanup.c (rest_of_handle_jump): Update.
	* explow.c (allocate_dynamic_stack_space): Update.
	* varasm.c (assemble_start_function): Update.
	(force_const_mem): Update.
	(mark_constant_pool): Update.
	* tree-optimize.c (tree_rest_of_compilation): Update.
	* stack-ptr-mod.c (notice_stack_pointer_modification): Update.
	* tree-cfg.c (notice_special_calls): Update.
	(is_ctrl_altering_stmt): Update.
	(tree_can_make_abnormal_goto): Update.
	(tree_purge_dead_abnormal_call_edges): Update.
	* config/alpha/predicates.md: Update.
	* config/alpha/alpha.c (alpha_sa_mask): Update.
	(alpha_sa_size): Update.
	(alpha_does_function_need_gp): Update.
	(alpha_expand_prologue): Update.
	(alpha_start_function): Update.
	(alpha_output_function_end_prologue): Update.
	(alpha_expand_epilogue): Update.
	* config/frv/frv.c (frv_stack_info): Update.
	(frv_expand_epilogue): Update.
	* config/s390/s390.c (s390_regs_ever_clobbered): Update.
	(s390_register_info): Update.
	(s390_frame_info): Update.
	(s390_init_frame_layout): Update.
	(s390_can_eliminate): Update.
	(save_gprs): Update.
	* config/spu/spu.c (spu_split_immediate): Update.
	(need_to_save_reg): Update.
	(spu_expand_prologue): Update.
	(spu_expand_epilogue): Update.
	* config/sparc/sparc.md: Update.
	* config/sparc/sparc.c (eligible_for_return_delay): Update.
	(sparc_tls_got): Update.
	(legitimize_pic_address): Update.
	(sparc_emit_call_insn): Update.
	(sparc_expand_prologue): Update.
	(output_return): Update.
	(print_operand): Update.
	(sparc_function_ok_for_sibcall): Update.
	* config/sparc/sparc.h (EXIT_IGNORE_STACK): Update.
	* config/m32r/m32r.md: Update.
	* config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update.
	(m32r_compute_frame_size): Update.
	(m32r_expand_prologue): Update.
	(m32r_expand_epilogue): Update.
	(m32r_legitimize_pic_address): Update.
	* config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update.
	* config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
	* config/i386/i386.c (ix86_frame_pointer_required): Update.
	(gen_push): Update.
	(ix86_save_reg): Update.
	(ix86_compute_frame_layout): Update.
	(ix86_expand_prologue): Update.
	(ix86_expand_epilogue): Update.
	* config/sh/sh.c (output_stack_adjust): Update.
	(calc_live_regs): Update.
	(sh5_schedule_saves): Update.
	(sh_expand_prologue): Update.
	(sh_expand_epilogue): Update.
	(sh_setup_incoming_varargs): Update.
	(sh_allocate_initial_value): Update.
	(sh_get_pr_initial_val): Update.
	* config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update.
	* config/sh/sh.md (label:): Update.
	* config/avr/avr.c (out_movhi_mr_r): Update.
	* config/crx/crx.h (enum): Update.
	* config/xtensa/xtensa.h (along): Update.
	* config/stormy16/stormy16.c Update.
	(xstormy16_compute_stack_layout): Update.
	* config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update.
	(fr30_expand_prologue): Update.
	* config/cris/cris.c (cris_conditional_register_usage): Update.
	(cris_reg_saved_in_regsave_area): Update.
	(cris_initial_frame_pointer_offset): Update.
	(cris_simple_epilogue): Update.
	(cris_expand_prologue): Update.
	(cris_expand_epilogue): Update.
	(cris_expand_pic_call_address): Update.
	(cris_asm_output_symbol_ref): Update.
	(cris_asm_output_label_ref): Update.
	* config/cris/cris.md Update.
	* config/iq2000/iq2000.c (compute_frame_size): Update.
	(iq2000_expand_epilogue): Update.
	* config/mt/mt.h (save_direction): Update.
	* config/mn10300/mn10300.c (mn10300_function_value): Update.
	* config/ia64/ia64.c (ia64_compute_frame_size): Update.
	(ia64_secondary_reload_class): Update.
	* config/m68k/m68k.c (m68k_save_reg): Update.
	(m68k_expand_prologue): Update.
	(m68k_expand_epilogue): Update.
	(legitimize_pic_address): Update.
	* config/rs6000/rs6000.c (rs6000_got_register): Update.
	(first_reg_to_save): Update.
	(first_altivec_reg_to_save): Update.
	(compute_vrsave_mask): Update.
	(compute_save_world_info): Update.
	(rs6000_stack_info): Update.
	(spe_func_has_64bit_regs_p): Update.
	(rs6000_ra_ever_killed): Update.
	(rs6000_emit_eh_reg_restore): Update.
	(rs6000_emit_allocate_stack): Update.
	(rs6000_emit_prologue): Update.
	(rs6000_emit_epilogue): Update.
	(rs6000_output_function_epilogue): Update.
	(output_profile_hook): Update.
	(rs6000_elf_declare_function_name): Update.
	* config/rs6000/rs6000.h (rs6000_args): Update.
	* config/rs6000/rs6000.md: Update.
	* config/mcore/mcore.c (mcore_expand_prolog): Update.
	* config/arc/arc.c (arc_output_function_epilogue): Update.
	* config/arc/arc.h (FRAME_POINTER_REQUIRED): Update.
	* config/darwin.c (machopic_function_base_name): Update.
	* config/score/score3.c (score3_compute_frame_size): Update.
	(rpush): Update.
	(rpop): Update.
	(score3_epilogue): Update.
	* config/score/score7.c (score7_compute_frame_size): Update.
	(score7_prologue): Update.
	(score7_epilogue): Update.
	* config/score/score.h (FRAME_POINTER_REQUIRED): Update.
	* config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
	* config/arm/arm.c (use_return_insn): Update.
	(require_pic_register): Update.
	(arm_load_pic_register): Update.
	(arm_compute_save_reg0_reg12_mask): Update.
	(arm_compute_save_reg_mask): Update.
	(thumb1_compute_save_reg_mask): Update.
	(output_return_instruction): Update.
	(arm_output_function_prologue): Update.
	(arm_output_epilogue): Update.
	(arm_get_frame_offsets): Update.
	(arm_expand_prologue): Update.
	(thumb_pushpop): Update.
	(thumb_exit): Update.
	(thumb1_expand_prologue): Update.
	(thumb1_expand_epilogue): Update.
	(arm_unwind_emit): Update.
	(arm_output_fn_unwind): Update.
	* config/arm/arm.h (FRAME_POINTER_REQUIRED): Update.
	* config/arm/arm.md: Update.
	* config/pa/pa.md: Update.
	* config/pa/pa.c (legitimize_pic_address): Update.
	(compute_frame_size): Update.
	(hppa_expand_prologue): Update.
	(hppa_expand_epilogue): Update.
	(borx_reg_operand): Update.
	* config/pa/pa.h (FRAME_POINTER_REQUIRED): Update.
	(HARD_REGNO_RENAME_OK): Update.
	* config/mips/mips.c (mips_global_pointer): Update.
	(mips_save_reg_p): Update.
	(mips_compute_frame_info): Update.
	(mips_frame_pointer_required): Update.
	(mips_expand_prologue): Update.
	(mips_expand_epilogue): Update.
	(mips_can_use_return_insn): Update.
	(mips_reorg_process_insns): Update.
	* config/v850/v850.c (compute_register_save_size): Update.
	* config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update.
	* config/mmix/mmix.c (along): Update.
	(mmix_expand_epilogue): Update.
	* config/bfin/bfin.c (legitimize_pic_address): Update.
	(must_save_p): Update.
	(stack_frame_needed_p): Update.
	(add_to_reg): Update.
	(bfin_expand_prologue): Update.
	* stmt.c (expand_asm_operands): Update.
	* reload1.c (reload): Update.
	(init_elim_table): Update.

From-SVN: r134682
2008-04-25 23:14:40 +00:00
Adam Nemet 5fb79e4c29 mips.md (GPR2): New mode iterator.
* config/mips/mips.md (GPR2): New mode iterator.
	(seq): Add comment.
	(*seq_<mode>, *seq_<mode>_mips16, *sne_<mode>, *sgt<u>_<mode>,
	*sgt<u>_<mode>_mips16, *sge<u>_<mode>, *slt<u>_<mode>,
	*slt<u>_<mode>_mips16 *sle<u>_<mode>, *sle<u>_<mode>_mips16):
	Rewrite these to take two modes, the mode of comparison and the
	mode of the destination.
	* config/mips/mips.c (mips_expand_scc): Instead of having
	paradoxical subreg as destination, expand "narrowing" scc if mode
	of comparison is SI and target is requested in DI mode.
	(mips_emit_int_order_test): Update comment.  Make mode of
	comparison match CMP0 rather than TARGET.  When creating inverse
	target use mode of TARGET.

testsuite/

	* gcc.target/mips/scc-2.c: New test.
	* gcc.target/mips/scc-3.c: New test.
	* gcc.target/mips/scc-4.c: New test.

From-SVN: r134167
2008-04-10 18:28:45 +00:00
Jan Hubicka 38173d38cc function.h (incomming_args): Break out of struct function.
* function.h (incomming_args): Break out of struct function.
	(function_subsections): Break out of struct function.
	(rtl_data): Add args, subsections fields. Break out outgoing_args_size,
	return_rtx and hard_reg_initial_vals from struct function.
	Kill inl_max_label_num.
	(current_function_pops_args, current_function_args_info,
	current_function_args_size, current_function_args_size,
	current_function_pretend_args_size,
	current_function_outgoing_args_size,
	current_function_internal_arg_pointer, current_function_return_rtx):
	Kill compatibility accestor macros.
	* builtins.c (expand_builtin_apply_args_1): Update.
	(expand_builtin_next_arg): Update.
	* df-scan.c (df_get_call_refs): Update.
	* dbxout.c (dbxout_function_end): Update.
	* dwarf2out.c (dwarf2out_switch_text_section): Update.
	(output_line_info): Update.
	(secname_for_decl): Update.
	(dwarf2out_var_location): Update.
	* function.c (free_after_compilation): Update.
	(assign_parm_find_stack_rtl): Update.
	(assign_parms): Update.
	(expand_dummy_function_end): Update.
	(expand_function_end): Update.
	* calls.c (mem_overlaps_already_clobbered_arg_p): Update.
	(expand_call): Update.
	(emit_library_call_value_1): Update.
	(store_one_arg): Update.
	* varasm.c (initialize_cold_section_name): Update.
	(unlikely_text_section): Update.
	(unlikely_text_section_p): Update.
	(assemble_start_function): Update.
	(assemble_end_function): Update.
	(default_section_type_flags): Update.
	(switch_to_section): Update.
	* integrate.c (set_decl_abstract_flags): Update.
	(get_hard_reg_initial_val): Update.
	(has_hard_reg_initial_val): Update.
	(allocate_initial_values): Update.
	* resource.c (init_resource_info): Update.
	* config/alpha/alpha.c (NUM_ARGS): Update.
	(direct_return): Update.
	(alpha_va_start): Update.
	(alpha_sa_size): Update.
	(alpha_initial_elimination_offset): Update.
	(alpha_expand_prologue): Update.
	(alpha_start_function): Update.
	(alpha_expand_epilogue): Update.
	(unicosmk_initial_elimination_offset):
	* config/alpha/alpha.md (call expander): Update.
	* config/s390/s390.c (s390_register_info): Update.
	(s390_register_info): Update.
	(s390_frame_info): Update.
	(s390_initial_elimination_offset): Update.
	(s390_build_builtin_va_list): Update.
	(s390_va_start): Update.
	* config/spu/spu.c (direct_return): Update.
	(spu_expand_prologue): Update.
	(spu_initial_elimination_offset): Update.
	(spu_build_builtin_va_list): Update.
	(spu_va_start): Update.
	* config/sparc/sparc.c (sparc_init_modes): Update.
	(sparc_compute_frame_size): Update.
	(function_value): Update.
	* config/m32r/m32r.c (m32r_compute_frame_size): Update.
	* config/i386/i386.md (return expander): Update.
	* config/i386/i386.c (ix86_va_start): Update.
	(ix86_can_use_return_insn_p): Update.
	(ix86_compute_frame_layout): Update.
	(ix86_expand_epilogue): Update.
	* config/sh/sh.c (output_stack_adjust): Update.
	(calc_live_regs): Update.
	(sh_expand_prologue): Update.
	(sh_builtin_saveregs): Update.
	(sh_va_start): Update.
	(initial_elimination_offset): Update.
	(sh_allocate_initial_value): Update.
	(sh_function_ok_for_sibcall): Update.
	(sh_get_pr_initial_val): Update.
	* config/sh/sh.md (return expander): Update.
	* config/avr/avr.c (frame_pointer_required_p): UPdate.
	* config/crx/crx.c (crx_compute_frame): UPdate.
	(crx_initial_elimination_offset): UPdate.
	* config/xtensa/xtensa.c (compute_frame_size): Update
	(xtensa_builtin_saveregs): Update.
	(xtensa_va_start): Update.
	(order_regs_for_local_alloc): Update.
	* config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update.
	(xstormy16_expand_builtin_va_start): Update.
	* config/fr30/fr30.c (fr30_compute_frame_size): Update.
	* config/m68hc11/m68hc11.md (return expanders): Update.
	* config/m68hc11/m68hc11.c (expand_prologue): Update.
	(expand_epilogue): Update.
	* config/cris/cris.c (cris_initial_frame_pointer_offset): Update.
	(cris_simple_epilogue): Update.
	(cris_expand_prologue): Update.
	(cris_expand_epilogue): Update.
	* config/iq2000/iq2000.c (iq2000_va_start): Update.
	(compute_frame_size): Update.
	* config/mt/mt.c (mt_compute_frame_size): Update.
	* config/mn10300/mn10300.c (expand_prologue): Update.
	(expand_epilogue): Update.
	(initial_offset): Update.
	(mn10300_builtin_saveregs):
	* config/mn10300/mn10300.md (return expander): Update.
	* config/ia64/ia64.c (ia64_compute_frame_size): Update.
	(ia64_initial_elimination_offset): Update.
	(ia64_initial_elimination_offset): Update.
	(ia64_expand_prologue): Update.
	* config/m68k/m68k.md (return expander): Update.
	* config/rs6000/rs6000.c (rs6000_va_start): Update.
	(rs6000_stack_info): Update.
	* config/mcore/mcore.c (layout_mcore_frame): Update.
	(mcore_expand_prolog): Update.
	* config/arc/arc.c (arc_compute_frame_size): Update.
	* config/score/score3.c (score3_compute_frame_size): Update.
	* config/score/score7.c (score7_compute_frame_size): Update.
	* config/arm/arm.c (use_return_insn): Update.
	(thumb_find_work_register): Update.
	(arm_compute_save_reg_mask): Update.
	(arm_output_function_prologue): Update.
	(arm_output_epilogue): Update.
	(arm_size_return_regs): Update.
	(arm_get_frame_offsets): Update.
	(arm_expand_prologue): Update.
	(thumb_exit): Update.
	(thumb_unexpanded_epilogue): Update.
	(thumb1_output_function_prologue): Update.
	* config/pa/pa.md (return expander): Update.
	* config/pa/pa.c (compute_frame_size): Update.
	(hppa_builtin_saveregs): Update.
	* config/mips/mips.c (mips_va_start): Update.
	(mips16_build_function_stub): Update.
	(mips_compute_frame_info): Update.
	(mips_restore_gp): Update.
	(mips_output_function_prologue): Update.
	(mips_expand_prologue): Update.
	* config/v850/v850.c (compute_frame_size): Update.
	(expand_prologue): * config/mmix/mmix.c (along): update.
	(mmix_initial_elimination_offset): update.
	(mmix_reorg): update.
	(mmix_use_simple_return): update.
	(mmix_expand_prologue): update.
	(mmix_expand_epilogue): Update.
	* config/bfin/bfin.c (bfin_initial_elimination_offset): Update.
	(emit_link_insn): Update.

From-SVN: r134087
2008-04-08 08:59:34 +00:00
Jan Hubicka 6b0c2336ba re PR target/35795 (Revision 133787 breaks ia64)
2008-04-03  Jan Hubicka  <jh@suse.cz>

	PR tree-optimization/35795
	* alpha/alpha.c (alpha_output_mi_thunk_osf): Free after compilation.
	* sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* m68k/m68k.c (m68k_output_mi_thunk): Likewise.
	* score/score3.c (score3_output_mi_thunk): Likewise.
	* score/score7.c (score7_output_mi_thunk): Likewise.
	* mips/mips.c (mips_output_mi_thunk): Likewise.

From-SVN: r133868
2008-04-03 05:49:27 -07:00
Richard Sandiford 5ca3d30cfb re PR target/34900 (target mips64vrel-elf. Internal compiler error (in reload_cse_simplify_operands, at postreload.c:392) while building libiberty)
gcc/
	PR target/34900
	* config/mips/mips.c (gen_load_const_gp): New function, taking a
	comment from...
	(mips16_gp_pseudo_reg): ...here.
	* config/mips/mips.md (load_const_gp): Replace with...
	(load_const_gp_<mode>): ...this :P-based insn.

From-SVN: r131983
2008-01-31 19:28:03 +00:00
Richard Sandiford dbc90b6565 re PR target/34981 (Lazily-bound function called twice)
gcc/
	PR target/34981
	* config/mips/mips-protos.h (mips_expand_call): Return an rtx.
	* config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO
	to GOT_VERSION_REGNUM.
	(CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0.
	(EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT.
	* config/mips/mips.c (mips_emit_call_insn): New function.
	(mips_call_tls_get_addr): Call mips_expand_call directly.
	(mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than
	emit_call_insn.
	(mips16_build_call_stub): Likewise.  Return the call insn or null.
	(mips_expand_call): Update the call to mips16_build_call_stub
	accordingly and a remove redundant condition.  Assert that MIPS16
	stubs do not use lazy binding.  Use mips_emit_call_insn and return
	the call insn.
	(mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if
	TARGET_USE_GOT.
	(mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM.
	(mips_avoid_hazard): Remove hazard_set handling.
	* config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to...
	(UNSPEC_RESTORE_GP): ...this.
	(UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants.
	(FAKE_CALL_REGNO): Rename to...
	(GOT_VERSION_REGNUM): ...this.
	(type): Add "ghost" value.  Add an associated insn reservation.
	(hazard_set): Remove.
	(exception_receiver): Rename to...
	(restore_gp): ...this and update the unspec identifier accordingly.
	(exception_receiver, nonlocal_got_receiver): New expanders.
	(load_call<mode>): Use GOT_VERSION_REGNUM.  Don't set
	FAKE_CALL_REGNO.  Remove hazard_set attribute.
	(set_got_version, update_got_version): New patterns.

gcc/testsuite/
	PR target/34981
	* gcc.target/mips/lazy-binding-1.c: New test.
	* gcc.target/mips/mips.exp (setup_mips_tests): Set
	mips_forced_no_abicalls and mips_forced_no_shared.
	(dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi.
	Avoid using small data with -mabicalls.  Don't make -G0 force
	-mn-abicalls.  Skip -mabicalls and -mshared tests if the multilib
	forces the opposite option.

From-SVN: r131860
2008-01-26 10:22:14 +00:00
Richard Sandiford 2a4430a6f9 mips.c (mips_in_small_data_p): Reinstate size > 0 check.
gcc/
	* config/mips/mips.c (mips_in_small_data_p): Reinstate size > 0 check.

From-SVN: r131339
2008-01-05 16:47:50 +00:00
Richard Sandiford 5557aad231 mips.c (mips_emit_loadgp): Replace gen_* calls with separate gen_*_si and gen_*_di calls.
gcc/
	* config/mips/mips.c (mips_emit_loadgp): Replace gen_* calls with
	separate gen_*_si and gen_*_di calls.  Pass pic_offset_table_rtx
	as the first argument.
	* config/mips/mips.md (loadgp_newabi, loadgp_absolute)
	(loadgp_rtp): Rename to...
	(loadgp_newabi_<mode>, loadgp_absolute<mode>, loadgp_rtp<mode>):
	...these.  Add modes to all operands.  Add the target register
	as an operand.  Combine loadgp_rtp<mode> with its splitter.

From-SVN: r131118
2007-12-21 10:00:36 +00:00
Richard Sandiford dd748704c4 Fix last commit.
From-SVN: r130654
2007-12-06 17:54:59 +00:00
Richard Sandiford 0b6e16476f mips.c (mips_function_ok_for_sibcall): Use targetm.binds_local_p instead of DECL_EXTERNAL.
gcc/
	* config/mips/mips.c (mips_function_ok_for_sibcall): Use
	targetm.binds_local_p instead of DECL_EXTERNAL.

From-SVN: r130653
2007-12-06 17:48:43 +00:00
Jakub Jelinek d7bd8aebf6 re PR middle-end/20983 (varargs functions force va_list variable to stack unnecessarily)
PR middle-end/20983
	* tree-ssa-ccp.c (optimize_stdarg_builtin): New function.
	(execute_fold_all_builtins): Call it for BUILT_IN_VA_START,
	BUILT_IN_VA_COPY and BUILT_IN_VA_END.

	* target.h (struct ggc_target): Add expand_builtin_va_start
	hook.
	* target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define.
	(TARGET_INITIALIZER): Add it.
	* builtins.c (expand_builtin_va_start): Use
	targetm.expand_builtin_va_start hook instead of
	EXPAND_BUILTIN_VA_START macro.
	* alpha/alpha.c (alpha_va_start): Made static.
	(override_options): Clear targetm.expand_builtin_va_start if
	TARGET_UNICOSMK.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove.
	* alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove.
	* alpha/alpha-protos.h (alpha_va_start): Remove prototype.
	* xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove.
	* xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define.
	(xtensa_va_start): Made static.
	* xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype.
	* pa/pa-protos.h (hppa_va_start): Remove prototype.
	* pa/pa.h (EXPAND_BUILTIN_VA_START): Remove.
	* pa/pa.c (hppa_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype.
	* frv/frv.h (EXPAND_BUILTIN_VA_START): Remove.
	* i386/i386.c (override_options): Clear
	targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI.
	(ix86_va_start): Made static.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* i386/i386.h (EXPAND_BUILTIN_VA_START): Remove.
	* i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes.
	* iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype.
	* iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove.
	* iq2000/iq2000.c (iq2000_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype.
	* rs6000/rs6000.c (rs6000_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	(rs6000_override_options): Clear targetm.expand_builtin_va_start if
	DEFAULT_ABI != ABI_V4.
	* rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove.
	* spu/spu.c (spu_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* spu/spu.h (EXPAND_BUILTIN_VA_START): Remove.
	* spu/spu-protos.h spu_va_start): Remove prototype.
	* stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove.
	* stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start):
	Remove prototype.
	* stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made
	static.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* s390/s390-protos.h (s390_va_start): Remove prototype.
	* s390/s390.c (s390_va_start): Made static.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* s390/s390.h (EXPAND_BUILTIN_VA_START): Remove.
	* mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove.
	* mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype.
	* mn10300/mn10300.c (mn10300_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* arc/arc.c (arc_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* arc/arc.h (EXPAND_BUILTIN_VA_START): Remove.
	* arc/arc-protos.h (arc_va_start): Remove prototype.
	* mt/mt-protos.h (mt_va_start): Remove prototype.
	* sparc/sparc.c (sparc_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* sparc/sparc-protos.h (sparc_va_start): Remove prototype.
	* sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove.
	* sh/sh.c (sh_va_start): Made static, add prototype.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.
	* sh/sh-protos.h (sh_va_start): Remove prototype.
	* sh/sh.h (EXPAND_BUILTIN_VA_START): Remove.
	* mips/mips-protos.h (mips_va_start): Remove prototype.
	* mips/mips.h (EXPAND_BUILTIN_VA_START): Remove.
	* mips/mips.c (mips_va_start): Made static.
	(TARGET_EXPAND_BUILTIN_VA_START): Define.

From-SVN: r130650
2007-12-06 14:25:37 +01:00
Thiemo Seufer 0a7ea4078e mips.c (mips_file_start): Add support for flagging 32-bit code with -mfp64 floating-point.
* config/mips/mips.c (mips_file_start): Add support for
	flagging 32-bit code with -mfp64 floating-point.

From-SVN: r130313
2007-11-20 13:48:55 +00:00
Richard Sandiford fd0d4c1fbb re PR target/34042 (Segfault in mips_cannot_change_mode_class)
gcc/
	PR target/34042
	* config/mips/mips.c (mips_return_fpr_single): New function.
	(mips_function_value): Use it when returning single-field
	aggregates in FPRs.
	(mips_expand_call): Handle the PARALLELs created by
	mips_return_fpr_single.

From-SVN: r130119
2007-11-12 20:05:46 +00:00
Richard Sandiford a3d977243d re PR target/33948 (Bootstrap broken on mips-sgi-irix6.5)
gcc/
	PR target/33948
	* config/mips/mips.c (mips_fpr_return_fields): Fix SCALAR_TYPE_P
	check.

From-SVN: r129794
2007-10-31 08:23:30 +00:00
Richard Sandiford 9a4a025a01 re PR target/33895 (mips.c:6868: error: 'mips_output_dwarf_dtprel' defined but not used)
gcc/
	PR target/33895
	* config/mips/mips.c (mips_output_dwarf_dtprel): Add ATTRIBUTE_UNUSED.

From-SVN: r129694
2007-10-28 11:19:49 +00:00
Richard Sandiford a35de34276 re PR target/33755 (Gcc 4.2.2 broken for mips linux kernel builds)
gcc/
	PR target/33755
	* config/mips/mips.c (mips_lo_sum_offset): New structure.
	(mips_hash_base, mips_lo_sum_offset_hash, mips_lo_sum_offset_eq)
	(mips_lo_sum_offset_lookup, mips_record_lo_sum)
	(mips_orphaned_high_part_p: New functions.
	(mips_avoid_hazard): Don't check INSN_P here.
	(mips_avoid_hazards): Rename to...
	(mips_reorg_process_insns): ...this.  Cope with
	!TARGET_EXPLICIT_RELOCS.  Delete orphaned high-part relocations,
	or turn them into nops.
	(mips_reorg): Remove TARGET_EXPLICIT_RELOCS check from calls to
	dbr_schedule and mips_avoid_hazards/mips_reorg_process_insns.
	(mips_set_mips16_mode): Don't set flag_delayed_branch here.
	(mips_override_options): Set flag_delayed_branch to 0.

gcc/testsuite/
	PR target/33755
	* gcc.target/mips/pr33755.c: New test.

From-SVN: r129606
2007-10-24 17:52:16 +00:00
Richard Sandiford a1c6b246b5 mips.h (MOVE_MAX): Use UNITS_PER_WORD and describe MIPS-specific implementation details.
gcc/
	* config/mips/mips.h (MOVE_MAX): Use UNITS_PER_WORD and describe
	MIPS-specific implementation details.
	(MIPS_MAX_MOVE_BYTES_PER_LOOP_ITER): New macro.
	(MIPS_MAX_MOVE_BYTES_STRAIGHT): Likewise.
	(MOVE_RATIO): Define to MIPS_MAX_MOVE_BYTES_STRAIGHT / UNITS_PER_WORD
	for targets with movmemsi.
	(MOVE_BY_PIECES_P): Define.
	* config/mips/mips.c (MAX_MOVE_REGS, MAX_MOVE_BYTES): Delete.
	(mips_block_move_loop): Add a bytes_per_iter argument.
	(mips_expand_block_move): Use MIPS_MAX_MOVE_BYTES_STRAIGHT.
	Update call to mips_block_move_loop.

From-SVN: r129605
2007-10-24 17:46:39 +00:00
Richard Sandiford 65239d2068 mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int".
gcc/
	* config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give
	the STRICT_P argument type "bool" rather than "int".
	(mips_legitimate_address_p): Likewise.
	(fp_register_operand, lo_operand): Delete.
	(mips_subword): Give the HIGH_P argument type "bool" rather than "int".
	(mips_emit_scc): Rename to...
	(mips_expand_scc): ...this.
	(gen_conditional_branch): Rename to...
	(mips_expand_conditional_branch): ...this.
	(gen_conditional_move): Rename to...
	(mips_expand_conditional_move): ...this.
	(mips_gen_conditional_trap): Rename to...
	(mips_expand_conditional_trap): ...this and take an rtx code instead
	of an operands array.
	(mips_expand_call): Give the SIBCALL_P argument type "bool"
	rather than "int".
	(mips_emit_fcc_reload): Rename to...
	(mips_expand_fcc_reload): ...this.
	(init_cumulative_args): Rename to...
	(mips_init_cumulative_args): ...this and remove the libname argument.
	(function_arg_advance): Rename to...
	(mips_function_arg_advance): ...this.
	(function_arg): Rename to...
	(mips_function_arg): ...this and use "rtx" instead of
	"struct rtx_def *".
	(function_arg_boundary): Rename to...
	(mips_function_arg_boundary): ...this.
	(mips_expand_unaligned_load): Rename to...
	(mips_expand_ext_as_unaligned_load): ...this and give the WIDTH
	and BITPOS arguments type "HOST_WIDE_INT".
	(mips_expand_unaligned_store): Rename to...
	(mips_expand_ins_as_unaligned_store): ...this and give the WIDTH
	and BITPOS arguments type "HOST_WIDE_INT".
	(override_options): Rename to...
	(mips_override_options): ...this.
	(print_operand): Rename to...
	(mips_print_operand): ...this.
	(print_operand_address): Rename to...
	(mips_print_operand_address): ...this.
	(mips_output_ascii): Remove the PREFIX argument.
	(mips_expand_epilogue): Give the SIBCALL_P argument type "bool"
	rather than "int".
	(mips_can_use_return_insn): Return a "bool" rather than an "int".
	(mips_function_value): Remove the FUNC argument.  Use "rtx" instead
	of "struct rtx_def *".
	(mips_secondary_reload_class): Give the IN_P argument type "bool"
	rather than "int".
	(build_mips16_call_stub): Delete.
	(mips_store_data_bypass_p): Return a "bool" rather than an "int".
	(mips_use_ins_ext_p): Give the second and third arguments type
	"HOST_WIDE_INT" rather than "rtx".
	* config/mips/mips.h: Update after the above changes.  Tweak comments
	and formatting.
	(SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument.
	(SECONDARY_OUTPUT_RELOAD_CLASS): Likewise.
	(mips_print_operand_punct, mips_hard_regno_mode_ok): Change the
	element type from "char" to "bool".
	(mips_section_threshold, sym_lineno, set_noat, mips_branch_likely)
	(mips_cpu_info_table): Delete.
	* config/mips/mips.md: Update after the above changes.  Tweak some
	formatting.
	* config/mips/mips-ps-3d.md: Likewise.
	* config/mips/mips.c: Tweak comments and formatting.
	Use NULL-like macros rather than 0 in various places.
	(mips_section_threshold): Rename to...
	(mips_small_data_threshold): ...this and give it an unsigned type.
	(num_source_filenames): Remove explicit initialization.
	(sdb_label_count): Likewise.
	(sym_lineno): Delete.
	(set_noat): Make static.
	(mips_branch_likely): Likewise, and give it type "bool".
	(mips_isa_info): Rename to...
	(mips_isa_option_info): ...this.
	(mips_flag_delayed_branch): Rename to...
	(mips_base_delayed_branch): ...this.
	(mips_split_addresses): Delete.
	(mips_print_operand_punct, mips_hard_regno_mode_ok): Change the
	element type from "char" to "bool".
	(mips_regno_to_class): Add an explicit array size.
	(mips16_flipper): Change from type "int" to type "bool".
	(mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check.
	(mips_tls_operand_p): Rename to...
	(mips_tls_symbol_p): ...this.
	(mips_global_symbol_p): Remove redundant "const".
	(mips_offset_within_alignment_p): Simplify.
	(mips_regno_mode_ok_for_base_p): Change the name of the last argument
	to STRICT_P and give it type bool.
	(mips_valid_base_register_p): Likewise.
	(mips_classify_address): Likewise.
	(mips_legitimate_address_p): Likewise.
	(mips16_unextended_reference_p): Take the offset as an
	"unsigned HOST_WIDE_INT" rather than an "rtx".  Simplify.
	(mips_const_insns): Use IN_RANGE.
	(mips_force_temporary): Remove an unnecessary copy_rtx.
	(mips16_gp_pseudo_reg): Simplify.
	(mips_split_symbol): Remove an unnecessary copy_rtx.
	(mips_legitimize_tls_address): Only create registers if we need them.
	(mips_legitimize_address): Use mips_split_plus.
	(mips_move_integer): Swap DEST and TEMP arguments.  Rename local
	variable COST to NUM_OPS.
	(mips_legitimize_move): Use gen_lowpart.
	(mips_rewrite_small_data): Rename the OP parameter to PATTERN.
	(m16_check_op): Use IN_RANGE.
	(mips_subword): Give the HIGH_P argument type "bool" rather than "int".
	(mips_split_doubleword_move): Pass booleans to mips_subword.
	(mips_output_move): Store the mode in a local variable.
	Explicitly assert that this function does not deal with
	MFLO and MFHI.  Use SMALL_OPERAND_UNSIGNED.  Make order of
	cases more consistent.
	(mips_relational_operand_ok_p): Rename to...
	(mips_int_order_operand_ok_p): ...this.
	(mips_canonicalize_comparison): Rename to...
	(mips_canonicalize_int_order_test): ...this.
	(mips_emit_int_relational): Rename to...
	(mips_emit_int_order_test): ...this.  Store the mode in a local
	variable.
	(mips_reverse_fp_cond_p): Rename to...
	(mips_reversed_fp_cond): ...this.
	(mips_emit_compare): Make the order of the statements more consistent.
	(mips_emit_scc): Rename to...
	(mips_expand_scc): ...this.
	(gen_conditional_branch): Rename to...
	(mips_expand_conditional_branch): ...this.
	(gen_conditional_move): Rename to...
	(mips_expand_conditional_move): ...this.  Build the condition
	separately from the main pattern.
	(mips_gen_conditional_trap): Rename to...
	(mips_expand_conditional_trap): ...this and take an rtx code instead
	of an operands array.  Simplify.
	(init_cumulative_args): Rename to...
	(mips_init_cumulative_args): ...this.  Use memset rather than a
	copy from a zeroed static.  Use prototype_p and stdarg_p.
	(mips_arg_info): Rename to...
	(mips_get_arg_info): ...this and put the INFO argument first.
	(function_arg): Rename to...
	(mips_function_arg): ...this and use "rtx" instead of
	"struct rtx_def *".  Only split structures into chunks if 
	TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on
	a chunk-by-chunk basis.  Use SCALAR_FLOAT_TYPE_P instead of a
	comparison with REAL_TYPE.  Rename local variable REG to REGNO
	and make it unsigned.
	(function_arg_advance): Rename to...
	(mips_function_arg_advance): ...this.
	(function_arg_boundary): Rename to...
	(mips_function_arg_boundary): ...this.
	(mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison
	with MODE_INT.
	(mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a
	comparison with REAL_TYPE.
	(mips_function_value): Remove the FUNC argument.  Rename local
	variable UNSIGNEDP to UNSIGNED_P.
	(mips_return_in_memory): Use IN_RANGE.
	(mips_setup_incoming_varargs): Pass a boolean rather than an int
	to FUNCTION_ARG_ADVANCE.
	(mips_gimplify_va_arg_expr): Rename local variable INDIRECT
	to INDIRECT_P.  Remove a redundant mips_abi check.  Only calculate
	SIZE and RSIZE if needed.
	(mips16_stub): Rename FPRET to FP_RET_P and give it type "bool"
	rather than "int".
	(build_mips16_function_stub): Rename to...
	(mips16_build_function_stub): ...this.
	(build_mips16_call_stub): Rename to...
	(mips16_build_call_stub): ...this.  Make static, and return a
	"bool" rather than an "int".  Rename the ARG_SIZE argument to
	ARGS_SIZE.  Rename the local variable FPRET to FP_RET_P and give
	it type "bool".  Use "jr" rather than "j".  Use XNEW.  Simplify.
	(mips_load_call_address): Give the SIBCALL_P argument type "bool"
	rather than "int".
	(mips_expand_call): Likewise.  Assert that MIPS16 calls via stubs
	are not sibling ones.
	(mips_emit_fcc_reload): Rename to...
	(mips_expand_fcc_reload): ...this.
	(mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type
	"HOST_WIDE_INT".
	(mips_expand_unaligned_load): Rename to...
	(mips_expand_ext_as_unaligned_load): ...this and give the WIDTH
	and BITPOS arguments type "HOST_WIDE_INT".  Remove redundant
	SUBREG_BYTE check.
	(mips_expand_unaligned_store): Rename to...
	(mips_expand_ins_as_unaligned_store): ...this and give the WIDTH
	and BITPOS arguments type "HOST_WIDE_INT".
	(mips_use_ins_ext_p): Rename second and third arguments to WIDTH
	and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx".
	Use IN_RANGE.
	(mips_init_split_addresses): Replace with...
	(mips_split_addresses_p): ...this new function.
	(mips_init_relocs): Check mips_split_addresses_p () rather than
	mips_split_addresses.  Always initialize mips_split_p with booleans.
	(print_operand_reloc): Rename to...
	(mips_print_operand_reloc): ...this.  Use a gcc_assert rather than
	a fatal_error.
	(print_operand): Rename to...
	(mips_print_operand): ...this.
	(print_operand_address): Rename to...
	(mips_print_operand_address): ...this.  Use GP_REG_FIRST.
	(mips_in_small_data_p): Simplify.
	(mips_output_ascii): Remove the PREFIX argument and "register"
	keywords.  Use the STRING parameter directly and cast to
	"unsigned char".
	(mips16e_collect_argument_save_p): Use IN_RANGE.
	(mips_function_has_gp_insn): Simplify.
	(mips_set_return_address): Use BITSET_P.
	(mips_restore_gp): Use a separate statement to pick the base
	register.
	(mips_output_function_prologue): Use a local FRAME variable.
	(mips_save_reg): Pass booleans to mips_subword.
	(mips_expand_prologue): Use a local FRAME variable.  Use
	cprestore_size to detect when .cprestore is needed.
	(mips_restore_reg): Use GP_REG_FIRST.
	(mips_expand_epilogue): Give the SIBCALL_P argument type "bool"
	rather than "int".  Use local FRAME and REGNO variables.
	(mips_can_use_return_insn): Return a "bool" rather than an "int".
	(mips_secondary_reload_class): Give the IN_P argument type "bool"
	rather than "int".
	(mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN.
	(mips_store_data_bypass_p): Return a "bool" rather than an "int".
	(vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P.
	(mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P.
	(mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P.
	(builtin_description): Rename to...
	(mips_builtin_description): ...this.
	(mips_bdesc): Rename to...
	(mips_ps_bdesc): ...this.
	(sb1_bdesc): Rename to...
	(mips_sb1_bdesc): ...this.
	(dsp_bdesc): Rename to...
	(mips_dsp_bdesc): ...this.
	(dsp_32only_bdesc): Rename to...
	(mips_dsp_32only_bdesc): ...this.
	(bdesc_map): Rename to...
	(mips_bdesc_map): ...this.
	(bdesc_arrays): Rename to...
	(mips_bdesc_arrays): ...this.
	(mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO.
	Tweak error message.
	(mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P.
	Rename local variables I and J to OPNO and ARGNO respectively.
	Assert that the number of arguments is no more than the number of
	input operands.
	(mips_expand_builtin_compare): Use an array of arguments rather
	than an array of operands.  Assert that the number of operands is
	as expected.
	(add_constant): Rename to...
	(mips16_add_constant): ...this.  Use XNEW.
	(dump_constants_1): Rename to...
	(mips16_emit_constants_1): ...this.  Use ALL_SCALAR_FIXED_POINT_MODE_P.
	(dump_constants): Rename to...
	(mips16_emit_constants): ...this.
	(mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO.
	(mips_set_mips16_mode): Don't call mips_init_split_addresses.
	Assign mips16_p to was_mips16_p.
	(mips_parse_cpu): Tweak warning message.
	(override_options): Rename to...
	(mips_override_options): ...this.  Move the mips_cost initialization
	out of the "shared with GAS" block.  Quote option names in error
	messages.
	(mips_conditional_register_usage): Make local variable REGNO unsigned.
	(mips_order_regs_for_local_alloc): Remove register keyword.

From-SVN: r129532
2007-10-21 11:19:40 +00:00
Richard Sandiford d375fd5e62 gcc/
* config/mips/mips.c (mips_set_mips16_mode) Say sorry for hard-float
	MIPS16 code unless using o32 or o64.  

gcc/testsuite/
	* gcc.target/mips/mips.exp (setup_mips_tests): Set mips_mips16.
	(dg-mips-options): Skip tests that specify an ABI other than o32
	and o64 if generating MIPS16 hard-float code.

From-SVN: r129530
2007-10-21 10:05:43 +00:00
Richard Sandiford 43029c1033 mips.c (mips_cannot_change_mode_class): Don't check for modes smaller than 4 bytes.
gcc/
	* config/mips/mips.c (mips_cannot_change_mode_class): Don't check
	for modes smaller than 4 bytes.
	* config/mips/mips.md (*movhi_internal, *movqi_internal): Remove
	FPR alternatives.

From-SVN: r129528
2007-10-21 09:24:16 +00:00
Richard Sandiford 7c6794f484 mips-protos.h (mips_output_aligned_bss): Delete.
gcc/
	* config/mips/mips-protos.h (mips_output_aligned_bss): Delete.
	* config/mips/linux.h (BSS_SECTION_ASM_OP): Delete.
	(ASM_OUTPUT_ALIGNED_BSS): Delete.
	* config/mips/mips.c (mips_output_aligned_bss): Delete.

From-SVN: r129527
2007-10-21 09:20:49 +00:00
Richard Sandiford 9be10a7944 mips.c (mips_function_ok_for_sibcall): Only forbid sibling calls to "mips16" functions if...
gcc/
	* config/mips/mips.c (mips_function_ok_for_sibcall): Only forbid
	sibling calls to "mips16" functions if the function satisfies
	const_call_insn_operand.

From-SVN: r129526
2007-10-21 09:18:12 +00:00
Richard Sandiford e0681eaad4 mips.c (mips_va_start): Fix types in calls to build_int_cst.
gcc/
	* config/mips/mips.c (mips_va_start): Fix types in calls
	to build_int_cst.

From-SVN: r129525
2007-10-21 09:15:50 +00:00
Richard Sandiford a1569a0e15 mips.c (mips_rtx_costs): Only recognize reciprocals if ISA_HAS_FP4.
gcc/
	* config/mips/mips.c (mips_rtx_costs): Only recognize reciprocals
	if ISA_HAS_FP4.

From-SVN: r129524
2007-10-21 09:13:06 +00:00