Commit Graph

23 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 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
Richard Sandiford 206c2d7add mips.c (mips_symbol_insns_1): Allow LEAs of SYMBOL_FORCE_TO_MEM constants.
gcc/
	* config/mips/mips.c (mips_symbol_insns_1): Allow LEAs of
	SYMBOL_FORCE_TO_MEM constants.
	(mips_rtx_costs): Give a cost of 1 to force_to_mem_operands.
	(mips16_rewrite_pool_refs_info): New structure.
	(mips16_rewrite_pool_constant): New function, split out from...
	(mips16_rewrite_pool_refs): ...here.  Take a pointer to a
	mips16_rewrite_pool_refs_info structure rather than a pointer
	to a constant pool.  Force force_to_mem_operands into memory.
	(mips16_lay_out_constants): Update call to mips16_rewrite_pool_refs.
	* config/mips/predicates.md (force_to_mem_operand): New predicate.
	* config/mips/constraints.md (kf): New constraint.
	* config/mips/mips.md (*movdi_64bit_mips16): Add a d <- kf alternative.
	(*movsi_mips16): Likewise.

From-SVN: r128365
2007-09-11 09:51:17 +00:00
Adam Nemet ac2610bf42 predicates.md (const_call_insn_operand): Invoke SYMBOL_REF_LONG_CALL_P only on SYMBOL_REFs.
* config/mips/predicates.md (const_call_insn_operand): Invoke
	SYMBOL_REF_LONG_CALL_P only on SYMBOL_REFs.

From-SVN: r127351
2007-08-10 22:11:43 +00:00
Richard Sandiford 390ea488c1 mips-protos.h (mips_split_symbol): Add a mode and an "rtx *" argument.
gcc/
	* config/mips/mips-protos.h (mips_split_symbol): Add a mode and
	an "rtx *" argument.  Return a bool.
	* config/mips/mips.c (mips_split_symbol): Accept arbitrary source
	values and return true if they can be split.  Take the same kind of
	mode argument as mips_symbol_insns.  Add a "lo_sum_out" parameter
	and store the lo_sum there if nonnull.  Use the symbol type to
	determine whether a $gp or HIGH is needed.
	(mips_legitimize_address): Update call to mips_split_symbol and
	simplify accordingly.
	(mips_legitimize_const_move): Likewise.
	* config/mips/mips.md: In the combine define_split,
	check mips_split_symbol instead of splittable_symbolic_operand.
	Update use of mips_split_symbol in the generator code.
	* config/mips/predicates.md (splittable_symbolic_operand): Delete.

From-SVN: r127298
2007-08-08 15:40:27 +00:00
Richard Sandiford 280fcbfab4 mips-protos.h (mips_symbol_context): New enumeration.
gcc/
	* config/mips/mips-protos.h (mips_symbol_context): New enumeration.
	* config/mips/mips.c (mips_classify_symbol): Take a context argument.
	(mips_symbolic_constant_p): Likewise.  Update the call to
	mips_classify_symbol.
	(mips_classify_address): Update the calls to mips_symbolic_constant_p.
	(mips_const_insns): Likewise.  Update the call to mips_classify_symbol.
	(mips_legitimize_address): Update the call to mips_symbolic_constant_p.
	(print_operand_reloc): Add a context argument.  Update the call to
	mips_symbolic_constant_p.
	(print_operand): Update the calls to print_operand_reloc.
	(print_operand_address): Use print_operand_reloc rather than
	print_operand.
	(mips_rewrite_small_data_p): Add a context argument.  Update the call
	to mips_symbolic_constant_p.
	(mips_small_data_pattern_1): Make DATA the containing mem.
	Update the call to mips_rewrite_small_data_p.
	(mips_rewrite_small_data_1): Likewise.
	(mips_use_anchors_for_symbol_p): Update the call to
	mips_symbolic_constant_p.
	* config/mips/predicates.md (const_call_insn_operand): Likewise.
	(splittable_symbolic_operand): Likewise.
	(move_operand): Likewise.
	(absolute_symbolic_operand): Likewise.
	(got_disp_operand): Likewise.
	(got_page_ofst_operand): Likewise.

From-SVN: r127295
2007-08-08 15:22:16 +00:00
Richard Sandiford 67da85da79 mips-protos.h (SYMBOL_GENERAL): Rename to...
gcc/
	* config/mips/mips-protos.h (SYMBOL_GENERAL): Rename to...
	(SYMBOL_ABSOLUTE): ...this.
	(SYMBOL_SMALL_DATA): Rename to...
	(SYMBOL_GP_RELATIVE): ...this.
	(SYMBOL_CONSTANT_POOL): Rename to...
	(SYMBOL_PC_RELATIVE): ...this.
	* config/mips/mips.c (mips_classify_symbol, mips_symbolic_constant_p)
	(mips_symbolic_address_p, mips_symbol_insns, override_options)
	(mips_rewrite_small_data_p, mips_use_anchors_for_symbol_p): Update
	after above changes.
	* config/mips/predicates.md (const_call_insn_operand): Likewise.
	(general_symbolic_operand): Rename to...
	(absolute_symbolic_operand): ...this.
	* config/mips/mips.md: Update after above changes.

From-SVN: r127294
2007-08-08 15:06:05 +00:00
Nick Clifton 2f83c7d6b5 host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License...
* config/host-hpux.c: Change copyright header to refer to version 3 of the GNU
  General Public License and to point readers at the COPYING3 file and the FSF's
  license web page.
* config/alpha/predicates.md, config/alpha/vms-ld.c,
config/alpha/linux.h, config/alpha/alpha.opt,
config/alpha/linux-elf.h, config/alpha/vms.h, config/alpha/elf.h,
config/alpha/vms-unwind.h, config/alpha/ev4.md,
config/alpha/ev6.md, config/alpha/alpha.c, config/alpha/vms-cc.c,
config/alpha/alpha.h, config/alpha/sync.md,
config/alpha/openbsd.h, config/alpha/alpha.md,
config/alpha/alpha-modes.def, config/alpha/ev5.md,
config/alpha/alpha-protos.h, config/alpha/freebsd.h,
config/alpha/osf5.h, config/alpha/netbsd.h, config/alpha/vms64.h,
config/alpha/constraints.md, config/alpha/osf.h,
config/alpha/xm-vms.h, config/alpha/unicosmk.h, config/linux.h,
config/frv/predicates.md, config/frv/frv.h, config/frv/linux.h,
config/frv/frv.md, config/frv/frv.opt, config/frv/frv-modes.def,
config/frv/frv-asm.h, config/frv/frv-protos.h,
config/frv/frv-abi.h, config/frv/frv.c, config/s390/tpf.h,
config/s390/s390.c, config/s390/predicates.md, config/s390/s390.h,
config/s390/linux.h, config/s390/tpf.md, config/s390/tpf.opt,
config/s390/2064.md, config/s390/2084.md, config/s390/s390.md,
config/s390/s390.opt, config/s390/s390-modes.def,
config/s390/fixdfdi.h, config/s390/constraints.md,
config/s390/s390-protos.h, config/s390/s390x.h, config/elfos.h,
config/dbxcoff.h, config/m32c/predicates.md, config/m32c/cond.md,
config/m32c/m32c.c, config/m32c/minmax.md, config/m32c/blkmov.md,
config/m32c/m32c-pragma.c, config/m32c/m32c.h,
config/m32c/prologue.md, config/m32c/m32c.abi,
config/m32c/muldiv.md, config/m32c/bitops.md, config/m32c/mov.md,
config/m32c/addsub.md, config/m32c/m32c.md, config/m32c/m32c.opt,
config/m32c/t-m32c, config/m32c/m32c-modes.def,
config/m32c/jump.md, config/m32c/shift.md,
config/m32c/m32c-protos.h, config/libgloss.h,
config/spu/spu-protos.h, config/spu/predicates.md,
config/spu/spu-builtins.h, config/spu/spu.c,
config/spu/spu-builtins.def, config/spu/spu-builtins.md,
config/spu/spu.h, config/spu/spu-elf.h, config/spu/constraints.md,
config/spu/spu.md, config/spu/spu-c.c, config/spu/spu.opt,
config/spu/spu-modes.def, config/spu/t-spu-elf, config/interix.h,
config/sparc/hypersparc.md, config/sparc/predicates.md,
config/sparc/linux.h, config/sparc/sp64-elf.h,
config/sparc/supersparc.md, config/sparc/cypress.md,
config/sparc/openbsd1-64.h, config/sparc/openbsd64.h,
config/sparc/niagara.md, config/sparc/sparc.md,
config/sparc/long-double-switch.opt, config/sparc/ultra3.md,
config/sparc/sparc.opt, config/sparc/sync.md,
config/sparc/sp-elf.h, config/sparc/sparc-protos.h,
config/sparc/ultra1_2.md, config/sparc/biarch64.h,
config/sparc/sparc.c, config/sparc/little-endian.opt,
config/sparc/sysv4-only.h, config/sparc/sparc.h,
config/sparc/linux64.h, config/sparc/freebsd.h,
config/sparc/sol2.h, config/sparc/rtemself.h,
config/sparc/netbsd-elf.h, config/sparc/vxworks.h,
config/sparc/sparc-modes.def, config/sparc/sparclet.md,
config/sparc/sysv4.h, config/vx-common.h, config/netbsd-aout.h,
config/flat.h, config/m32r/m32r.md, config/m32r/predicates.md,
config/m32r/little.h, config/m32r/m32r.c, config/m32r/m32r.opt,
config/m32r/linux.h, config/m32r/constraints.md,
config/m32r/m32r.h, config/m32r/m32r-protos.h, config/vxworks.opt,
config/darwin-c.c, config/darwin.opt, config/i386/i386.h,
config/i386/cygming.h, config/i386/linux.h, config/i386/cygwin.h,
config/i386/i386.md, config/i386/netware-crt0.c,
config/i386/sco5.h, config/i386/mmx.md, config/i386/vx-common.h,
config/i386/kaos-i386.h, config/i386/winnt-stubs.c,
config/i386/netbsd64.h, config/i386/djgpp.h, config/i386/gas.h,
config/i386/sol2.h, config/i386/constraints.md,
config/i386/netware-libgcc.c, config/i386/sysv5.h,
config/i386/predicates.md, config/i386/geode.md,
config/i386/x86-64.h, config/i386/kfreebsd-gnu.h,
config/i386/freebsd64.h, config/i386/vxworksae.h,
config/i386/pentium.md, config/i386/lynx.h, config/i386/i386elf.h,
config/i386/rtemself.h, config/i386/netbsd-elf.h,
config/i386/ppro.md, config/i386/k6.md, config/i386/netware.c,
config/i386/netware.h, config/i386/i386-modes.def,
config/i386/sysv4-cpp.h, config/i386/i386-interix.h,
config/i386/cygwin1.c, config/i386/djgpp.opt, config/i386/uwin.h,
config/i386/unix.h, config/i386/ptx4-i.h, config/i386/xm-djgpp.h,
config/i386/att.h, config/i386/winnt.c, config/i386/beos-elf.h,
config/i386/sol2-10.h, config/i386/darwin64.h, config/i386/sse.md,
config/i386/i386.opt, config/i386/bsd.h, config/i386/cygming.opt,
config/i386/xm-mingw32.h, config/i386/linux64.h,
config/i386/openbsdelf.h, config/i386/xm-cygwin.h,
config/i386/sco5.opt, config/i386/darwin.h, config/i386/mingw32.h,
config/i386/winnt-cxx.c, config/i386/i386-interix3.h,
config/i386/nwld.c, config/i386/nwld.h, config/i386/host-cygwin.c,
config/i386/cygwin2.c, config/i386/i386-protos.h,
config/i386/sync.md, config/i386/openbsd.h,
config/i386/host-mingw32.c, config/i386/i386-aout.h,
config/i386/nto.h, config/i386/biarch64.h,
config/i386/i386-coff.h, config/i386/freebsd.h,
config/i386/driver-i386.c, config/i386/knetbsd-gnu.h,
config/i386/host-i386-darwin.c, config/i386/vxworks.h,
config/i386/crtdll.h, config/i386/i386.c, config/i386/sysv4.h,
config/darwin-protos.h, config/linux.opt, config/sol2.c,
config/sol2.h, config/sh/symbian.c, config/sh/sh-protos.h,
config/sh/linux.h, config/sh/elf.h, config/sh/superh.h,
config/sh/sh4.md, config/sh/coff.h, config/sh/newlib.h,
config/sh/embed-elf.h, config/sh/symbian-pre.h, config/sh/rtems.h,
config/sh/kaos-sh.h, config/sh/sh4a.md, config/sh/constraints.md,
config/sh/sh64.h, config/sh/sh.opt, config/sh/symbian-post.h,
config/sh/sh-c.c, config/sh/predicates.md, config/sh/sh.c,
config/sh/sh.h, config/sh/shmedia.md, config/sh/sh-modes.def,
config/sh/little.h, config/sh/sh1.md, config/sh/sh4-300.md,
config/sh/superh64.h, config/sh/rtemself.h,
config/sh/netbsd-elf.h, config/sh/sh.md, config/sh/vxworks.h,
config/usegas.h, config/svr3.h, config/pdp11/pdp11-protos.h,
config/pdp11/2bsd.h, config/pdp11/pdp11.md, config/pdp11/pdp11.c,
config/pdp11/pdp11.opt, config/pdp11/pdp11-modes.def,
config/pdp11/pdp11.h, config/avr/rtems.h, config/avr/avr-protos.h,
config/avr/predicates.md, config/avr/constraints.md,
config/avr/avr.md, config/avr/avr.c, config/avr/avr.opt,
config/avr/avr.h, config/sol2-protos.h, config/dbxelf.h,
config/lynx.opt, config/crx/crx.h, config/crx/crx-protos.h,
config/crx/crx.md, config/crx/crx.c, config/crx/crx.opt,
config/c4x/c4x-c.c, config/c4x/c4x.c, config/c4x/c4x.opt,
config/c4x/c4x-modes.def, config/c4x/rtems.h,
config/c4x/predicates.md, config/c4x/c4x.h,
config/c4x/c4x-protos.h, config/c4x/c4x.md, config/kfreebsd-gnu.h,
config/xtensa/predicates.md, config/xtensa/xtensa.c,
config/xtensa/linux.h, config/xtensa/xtensa.h,
config/xtensa/elf.h, config/xtensa/xtensa.md,
config/xtensa/xtensa.opt, config/xtensa/constraints.md,
config/xtensa/xtensa-protos.h, config/dbx.h,
config/stormy16/predicates.md, config/stormy16/stormy16.md,
config/stormy16/stormy16.c, config/stormy16/stormy16.opt,
config/stormy16/stormy16.h, config/stormy16/stormy16-protos.h,
config/host-solaris.c, config/fr30/fr30.h,
config/fr30/predicates.md, config/fr30/fr30-protos.h,
config/fr30/fr30.md, config/fr30/fr30.c, config/fr30/fr30.opt,
config/vxworksae.h, config/sol2-c.c, config/lynx.h,
config/m68hc11/m68hc11-protos.h, config/m68hc11/predicates.md,
config/m68hc11/m68hc11.md, config/m68hc11/m68hc11.c,
config/m68hc11/m68hc11.opt, config/m68hc11/m68hc11.h,
config/m68hc11/m68hc12.h, config/openbsd-oldgas.h,
config/host-linux.c, config/interix3.h, config/cris/cris.c,
config/cris/predicates.md, config/cris/linux.h,
config/cris/cris.h, config/cris/aout.h, config/cris/cris.md,
config/cris/linux.opt, config/cris/cris.opt, config/cris/elf.opt,
config/cris/aout.opt, config/cris/cris-protos.h,
config/vxworks-dummy.h, config/netbsd.h, config/netbsd-elf.h,
config/iq2000/iq2000.h, config/iq2000/predicates.md,
config/iq2000/iq2000-protos.h, config/iq2000/iq2000.md,
config/iq2000/iq2000.c, config/iq2000/iq2000.opt,
config/host-darwin.c, config/mt/mt.md, config/mt/mt.c,
config/mt/mt.opt, config/mt/t-mt, config/mt/mt.h,
config/mt/mt-protos.h, config/svr4.h, config/host-darwin.h,
config/chorus.h, config/mn10300/mn10300.c,
config/mn10300/mn10300.opt, config/mn10300/predicates.md,
config/mn10300/mn10300.h, config/mn10300/linux.h,
config/mn10300/constraints.md, config/mn10300/mn10300-protos.h,
config/mn10300/mn10300.md, config/ia64/predicates.md,
config/ia64/itanium1.md, config/ia64/unwind-ia64.h,
config/ia64/ia64-c.c, config/ia64/sync.md, config/ia64/ia64.c,
config/ia64/itanium2.md, config/ia64/ia64.h, config/ia64/vect.md,
config/ia64/freebsd.h, config/ia64/ia64.md,
config/ia64/ia64-modes.def, config/ia64/constraints.md,
config/ia64/hpux.h, config/ia64/ia64-protos.h, config/windiss.h,
config/gofast.h, config/rtems.h, config/sol2-10.h,
config/m68k/predicates.md, config/m68k/m68k.md,
config/m68k/linux.h, config/m68k/m68k-modes.def,
config/m68k/print-sysroot-suffix.sh, config/m68k/m68k-protos.h,
config/m68k/coff.h, config/m68k/m68k-none.h, config/m68k/ieee.opt,
config/m68k/openbsd.h, config/m68k/m68k-aout.h,
config/m68k/m68k.opt, config/m68k/m68020-elf.h,
config/m68k/m68kelf.h, config/m68k/m68k-devices.def,
config/m68k/uclinux-oldabi.h, config/m68k/m68k.c,
config/m68k/constraints.md, config/m68k/rtemself.h,
config/m68k/netbsd-elf.h, config/m68k/m68k.h,
config/m68k/uclinux.h, config/rs6000/power4.md,
config/rs6000/host-darwin.c, config/rs6000/6xx.md,
config/rs6000/linux.h, config/rs6000/eabi.h,
config/rs6000/aix41.opt, config/rs6000/xcoff.h,
config/rs6000/secureplt.h, config/rs6000/linuxspe.h,
config/rs6000/eabialtivec.h, config/rs6000/8540.md,
config/rs6000/darwin8.h, config/rs6000/kaos-ppc.h,
config/rs6000/windiss.h, config/rs6000/603.md,
config/rs6000/aix41.h, config/rs6000/cell.md,
config/rs6000/mpc.md, config/rs6000/aix43.h, config/rs6000/beos.h,
config/rs6000/gnu.h, config/rs6000/rtems.h, config/rs6000/aix.opt,
config/rs6000/darwin.md, config/rs6000/darwin64.h,
config/rs6000/default64.h, config/rs6000/7xx.md,
config/rs6000/darwin.opt, config/rs6000/spe.md,
config/rs6000/rs6000.opt, config/rs6000/rs6000-c.c,
config/rs6000/rios2.md, config/rs6000/linuxaltivec.h,
config/rs6000/7450.md, config/rs6000/linux64.h,
config/rs6000/constraints.md, config/rs6000/440.md,
config/rs6000/darwin.h, config/rs6000/host-ppc64-darwin.c,
config/rs6000/rs6000.c, config/rs6000/aix52.h,
config/rs6000/rs6000.h, config/rs6000/power6.md,
config/rs6000/predicates.md, config/rs6000/altivec.md,
config/rs6000/aix64.opt, config/rs6000/rios1.md,
config/rs6000/rs6000-modes.def, config/rs6000/rs64.md,
config/rs6000/eabisim.h, config/rs6000/sysv4le.h,
config/rs6000/darwin7.h, config/rs6000/dfp.md,
config/rs6000/linux64.opt, config/rs6000/sync.md,
config/rs6000/vxworksae.h, config/rs6000/power5.md,
config/rs6000/lynx.h, config/rs6000/biarch64.h,
config/rs6000/rs6000.md, config/rs6000/sysv4.opt,
config/rs6000/eabispe.h, config/rs6000/e500.h,
config/rs6000/freebsd.h, config/rs6000/rs6000-protos.h,
config/rs6000/netbsd.h, config/rs6000/e500-double.h,
config/rs6000/aix.h, config/rs6000/vxworks.h,
config/rs6000/40x.md, config/rs6000/aix51.h,
config/rs6000/sysv4.h, config/arc/arc-protos.h, config/arc/arc.md,
config/arc/arc.c, config/arc/arc.opt, config/arc/arc-modes.def,
config/arc/arc.h, config/mcore/mcore-elf.h,
config/mcore/mcore-protos.h, config/mcore/predicates.md,
config/mcore/mcore.md, config/mcore/mcore.c,
config/mcore/mcore.opt, config/mcore/mcore.h,
config/mcore/mcore-pe.h, config/darwin.c, config/freebsd-nthr.h,
config/score/predicates.md, config/score/score-version.h,
config/score/score-protos.h, config/score/misc.md,
config/score/elf.h, config/score/score.c, config/score/mac.md,
config/score/score7.md, config/score/score.h,
config/score/score-conv.h, config/score/score-mdaux.c,
config/score/score.md, config/score/score.opt,
config/score/score-modes.def, config/score/score-mdaux.h,
config/score/mul-div.S, config/arm/uclinux-elf.h,
config/arm/semi.h, config/arm/ecos-elf.h, config/arm/arm1020e.md,
config/arm/symbian.h, config/arm/linux-elf.h,
config/arm/arm1026ejs.md, config/arm/arm1136jfs.md,
config/arm/elf.h, config/arm/aout.h, config/arm/arm.c,
config/arm/thumb2.md, config/arm/vec-common.md, config/arm/coff.h,
config/arm/strongarm-pe.h, config/arm/arm.h,
config/arm/cortex-a8-neon.md, config/arm/semiaof.h,
config/arm/cortex-a8.md, config/arm/uclinux-eabi.h,
config/arm/arm-modes.def, config/arm/linux-eabi.h,
config/arm/rtems-elf.h, config/arm/neon-schedgen.ml,
config/arm/arm-cores.def, config/arm/arm-protos.h,
config/arm/vfp.md, config/arm/aof.h, config/arm/linux-gas.h,
config/arm/wince-pe.h, config/arm/neon.md,
config/arm/constraints.md, config/arm/neon.ml,
config/arm/xscale-elf.h, config/arm/strongarm-coff.h,
config/arm/arm.opt, config/arm/arm926ejs.md,
config/arm/predicates.md, config/arm/iwmmxt.md,
config/arm/arm_neon.h, config/arm/unknown-elf.h,
config/arm/kaos-arm.h, config/arm/bpabi.h, config/arm/pe.opt,
config/arm/neon-testgen.ml, config/arm/arm.md,
config/arm/xscale-coff.h, config/arm/pe.c,
config/arm/arm-generic.md, config/arm/pe.h,
config/arm/kaos-strongarm.h, config/arm/freebsd.h,
config/arm/neon-docgen.ml, config/arm/netbsd.h, config/arm/fpa.md,
config/arm/strongarm-elf.h, config/arm/cirrus.md,
config/arm/netbsd-elf.h, config/arm/vxworks.h,
config/arm/neon-gen.ml, config/kaos.h, config/darwin-driver.c,
config/pa/predicates.md, config/pa/pa64-hpux.h,
config/pa/pa-hpux.opt, config/pa/som.h, config/pa/pa-hpux1010.opt,
config/pa/pa-hpux1111.opt, config/pa/pa-pro-end.h,
config/pa/elf.h, config/pa/fptr.c, config/pa/pa64-linux.h,
config/pa/pa.md, config/pa/pa.opt, config/pa/pa-hpux.h,
config/pa/pa-hpux10.h, config/pa/pa-hpux11.h,
config/pa/pa-hpux1010.h, config/pa/pa-protos.h,
config/pa/pa-osf.h, config/pa/pa-hpux1111.h, config/pa/pa-64.h,
config/pa/milli64.S, config/pa/pa.c, config/pa/pa-linux.h,
config/pa/pa.h, config/pa/pa32-linux.h, config/pa/pa64-hpux.opt,
config/pa/pa64-regs.h, config/pa/pa-modes.def,
config/pa/constraints.md, config/darwin9.h, config/mips/4100.md,
config/mips/linux.h, config/mips/elfoabi.h, config/mips/elf.h,
config/mips/sdb.h, config/mips/windiss.h, config/mips/rtems.h,
config/mips/3000.md, config/mips/iris5.h, config/mips/5000.md,
config/mips/7000.md, config/mips/9000.md, config/mips/4600.md,
config/mips/linux64.h, config/mips/elforion.h,
config/mips/constraints.md, config/mips/generic.md,
config/mips/predicates.md, config/mips/4300.md,
config/mips/mips-ps-3d.md, config/mips/iris.h, config/mips/24k.md,
config/mips/mips.md, config/mips/mips.opt, config/mips/4k.md,
config/mips/5k.md, config/mips/vr4120-div.S,
config/mips/openbsd.h, config/mips/iris6.h, config/mips/4000.md,
config/mips/mips-protos.h, config/mips/6000.md,
config/mips/mips.c, config/mips/mips.h, config/mips/r3900.h,
config/mips/74k.md, config/mips/netbsd.h, config/mips/vxworks.h,
config/mips/mips-modes.def, config/mips/vr.h,
config/soft-fp/t-softfp, config/openbsd.h, config/ptx4.h,
config/freebsd-spec.h, config/vax/vax.c, config/vax/openbsd.h,
config/vax/vax.h, config/vax/elf.h, config/vax/vax.md,
config/vax/bsd.h, config/vax/vax.opt, config/vax/vax-modes.def,
config/vax/openbsd1.h, config/vax/netbsd.h,
config/vax/vax-protos.h, config/vax/netbsd-elf.h,
config/vax/vaxv.h, config/vax/ultrix.h, config/freebsd.h,
config/h8300/rtems.h, config/h8300/predicates.md,
config/h8300/h8300.c, config/h8300/h8300.h, config/h8300/elf.h,
config/h8300/h8300.md, config/h8300/h8300.opt,
config/h8300/coff.h, config/h8300/h8300-protos.h,
config/v850/v850.md, config/v850/predicates.md,
config/v850/v850-c.c, config/v850/v850.c, config/v850/v850.opt,
config/v850/v850.h, config/v850/v850-protos.h, config/vxworks.c,
config/knetbsd-gnu.h, config/sol2-6.h, config/vxworks.h,
config/mmix/mmix.h, config/mmix/predicates.md,
config/mmix/mmix-protos.h, config/mmix/mmix.md,
config/mmix/mmix.c, config/mmix/mmix.opt,
config/mmix/mmix-modes.def, config/bfin/bfin.opt,
config/bfin/rtems.h, config/bfin/bfin-modes.def,
config/bfin/predicates.md, config/bfin/bfin-protos.h,
config/bfin/bfin.c, config/bfin/bfin.h, config/bfin/bfin.md: Likewise.

From-SVN: r127157
2007-08-02 10:49:31 +00:00
Sandra Loosemore cd3a59b38e mips.c (mips_attribute_table): Add "near" and "far" function attributes, "far" being an alias for "long_call".
2007-05-25  Sandra Loosemore  <sandra@codesourcery.com>
	    Nigel Stephens  <nigel@mips.com>

	gcc/
	* config/mips/mips.c (mips_attribute_table): Add "near" and "far"
	function attributes, "far" being an alias for "long_call".
	(TARGET_COMP_TYPE_ATTRIBUTES): Define as mips_comp_type_attributes.
	(mips_near_type_p, mips_far_type_p): New.
	(mips_comp_type_attributes): New function to check that attributes
	attached to a function type are compatible.
	(mips_output_mi_thunk): Test SYMBOL_REF_LONG_CALL_P() rather than
	TARGET_LONG_CALLS when deciding	whether we can do a direct sibcall
	to the target function of the thunk.
	(mips_encode_section_info): Check for "near" and "far" function
	attributes, and always set the SYMBOL_FLAG_LONG_CALL bit explicitly.

	* config/mips/predicates.md (const_call_insn_operand): Test only
	SYMBOL_REF_LONG_CALL_P() and not TARGET_LONG_CALLS.

	* doc/extend.texi (Function Attributes): Document MIPS "near" and
	"far" attributes.

	* testsuite/gcc.target/mips/near-far-1.c:  New test case.
	* testsuite/gcc.target/mips/near-far-2.c:  New test case.
	* testsuite/gcc.target/mips/near-far-3.c:  New test case.
	* testsuite/gcc.target/mips/near-far-4.c:  New test case.

Co-Authored-By: Nigel Stephens <nigel@mips.com>

From-SVN: r125086
2007-05-25 22:02:37 -04:00
Richard Sandiford 8cb6400cda Makefile.in (insn-emit.o): Depend on $(INTEGRATE_H).
gcc/
	* Makefile.in (insn-emit.o): Depend on $(INTEGRATE_H).
	* genemit.c (main): Emit #include "integrate.h".
	* config/mips/mips-protos.h (SYMBOL_HALF): New mips_symbol_type.
	(LOADGP_RTP): New mips_loadgp_style.
	* config/mips/mips.h: Include config/vxworks-dummy.h.
	(TARGET_RTP_PIC): New macro.
	(TARGET_USE_GOT): Return true for TARGET_RTP_PIC.
	(TARGET_USE_PIC_FN_ADDR_REG): Return true for TARGET_VXWORKS_RTP.
	(ASM_OUTPUT_ADDR_DIFF_ELT): Emit function-relative case tables
	for TARGET_RTP_PIC.
	* config/mips/vxworks.h (SUBTARGET_ASM_SPEC): Define.  Pass down
	-mvxworks-pic when using -mrtp and a PIC option.
	* config/mips/mips.c (mips_classify_symbol): Return SYMBOL_GOT_DISP
	for RTP PIC.
	(mips_symbolic_constant_p, mips_symbolic_address_p)
	(mips_symbol_insns): Handle SYMBOL_HALF.
	(override_options): Warn about -G and -mrtp being used together.
	Initialize mips_lo_relocs[SYMBOL_HALF].
	(mips_current_loadgp_style): Return LOADGP_RTP for RTP PIC.
	(mips_emit_loadgp): Handle LOADGP_RTP.
	(mips_in_small_data_p): Return false for TARGET_VXWORKS_RTP.
	* config/mips/mips.md (loadgp_rtp): New insn and splitter.
	(tablejump): Handle function-relative case table entries if
	TARGET_RTP_PIC.
	* config/mips/predicates.md (symbol_ref_operand): New predicate.

From-SVN: r123757
2007-04-12 17:59:57 +00:00
Richard Sandiford 08e7ceb3d3 mips-protos.h (SYMBOL_GOT_LOCAL): Rename to...
gcc/
	* config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to...
	(SYMBOL_GOT_PAGE_OFST): ...this.
	(SYMBOL_GOT_GLOBAL): Rename to...
	(SYMBOL_GOT_DISP): ...this.
	(SYMBOL_GOTOFF_GLOBAL): Rename to...
	(SYMBOL_GOTOFF_DISP): ...this.  Update comments accordingly.
	* config/mips/mips.c (mips_global_symbol_p): New function.
	(mips_symbol_binds_local_p): Likewise.
	(mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP
	and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST.  Use mips_global_symbol_p
	and mips_symbol_binds_local_p.
	(mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns)
	(override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP,
	SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to
	SYMBOL_GOTOFF_DISP.
	(mips_ok_for_lazy_binding_p): New function.
	(mips_load_call_address, mips_expand_call): Use it.
	(mips_dangerous_for_la25_p): Likewise.
	* config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>)
	(*got_disp<mode>): Use got_disp_operand instead of
	global_got_operand.  Use SYMBOL_GOTOFF_DISP instead of
	SYMBOL_GOTOFF_GLOBAL.
	(*got_page<mode>): Use got_page_ofst_operand instead of
	local_got_operand.
	* config/mips/predicates.md (const_call_insn_operand): Use
	SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL.
	(global_got_operand): Rename to...
	(got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of
	SYMBOL_GOT_GLOBAL.
	(local_got_operand): Rename to...
	(got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead
	of SYMBOL_GOT_LOCAL.

From-SVN: r123752
2007-04-12 17:26:45 +00:00
Richard Sandiford d9870b7ef4 predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS.
* config/mips/predicates.md (const_call_insn_operand): Allow direct
	calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS.
	* config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS.
	Use TARGET_OLDABI instead of !TARGET_NEWABI.
	(loadgp): Use mips_current_loadgp_style.
	(loadgp_noshared): New pattern.
	(sibcall_internal): Use MIPS_CALL.
	(sibcall_value_internal): Likewise.
	(sibcall_value_multiple_internal): Likewise.
	(call_internal): Likewise.
	(call_value_internal): Likewise.
	(call_value_multiple_internal): Likewise.
	(call_split): Use MIPS_CALL and add an 'S' constraint.
	(call_value_split): Likewise.
	(call_value_multiple_split): Likewise.
	* config/mips/mips.opt (-mabicalls): Tweak docstring.
	(-mshared): New option.
	* config/mips/mips-protos.h (mips_loadgp_style): New enum.
	(mips_current_loadgp_style): Declare.
	* config/mips/mips.c (mips_classify_symbol): Avoid using
	SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS.  Use SYMBOL_GENERAL
	rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if
	TARGET_ABSOLUTE_ABICALLS.
	(override_options): Adjust comments.  Improve the warning that is
	issued when -mabicalls and -G are used together.
	(mips_file_start): Remove comment.
	(mips_current_loadgp_style): New function.
	(mips_gnu_local_gp): New variable.
	(mips_emit_loadgp): Use mips_current_loadgp_style.  Handle
	LOADGP_ABSOLUTE.
	(mips_output_function_prologue): Use mips_current_laodgp_style.
	(mips_expand_prologue): Call mips_emit_loadgp before emitting
	the cprestore instruction.
	(mips_extra_live_on_entry): Fix reversed test.  Don't make $25
	live for TARGET_ABSOLUTE_ABICALLS.
	* config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro.
	(ASM_SPEC): Pass down -mshared and -mno-shared.
	(MIPS_CALL): New macro.
	* config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__
	definition.
	* doc/invoke.texi (-mabicalls): Update documentation.
	(-mshared): Document.

From-SVN: r112261
2006-03-21 21:49:13 +00:00
Richard Sandiford ea462dd06f predicates.md (splittable_const_int_operand): New, split from move_operand.
* config/mips/predicates.md (splittable_const_int_operand): New,
	split from move_operand.
	(splittable_symbolic_operand): New.
	(move_operand): Add commentary.  Use splittable_const_int_operand.
	Inline mips_atomic_symbolic_constant_p.
	* config/mips/mips.md: Add combine splitters for handling moves
	of splittable_const_int_operands and splittable_symbolic_operands.
	* config/mips/mips-protos.h (mips_atomic_symbolic_constant_p): Delete.
	(mips_split_symbol): Declare.
	(mips_move_integer): Declare.
	* config/mips/mips.c (mips_split_p): Make global.
	(TARGET_MIN_ANCHOR_OFFSET): Override default.
	(TARGET_MAX_ANCHOR_OFFSET): Likewise.
	(TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise.
	(TARGET_USE_ANCHORS_FOR_SYMBOL_P): Likewise.
	(mips_offset_within_object_p): Handle block symbols.
	(mips_atomic_symbolic_constant_p): Delete.
	(mips_cannot_force_const_mem): Return false for constants that
	mips_legitimize_move can handle.
	(mips_use_blocks_for_constant_p): New function.
	(mips_split_symbol): Make global.
	(mips_move_integer): Likewise.  Add a temporary register argument.
	(mips_legitimize_const_move): Use splittable_const_int_operand and
	splittable_symbolic_operand.
	(mips_use_anchors_for_symbol_p): New function.
	* config/mips/mips.h: Protect externs with !USED_FOR_TARGET.
	(mips_split_p): Declare.

From-SVN: r112150
2006-03-16 20:24:42 +00:00
Richard Sandiford a8c1d5f80e mips-protos.h (mips_output_conditional_branch): Change interface.
* config/mips/mips-protos.h (mips_output_conditional_branch): Change
	interface.
	(mips_output_order_conditional_branch): Declare.
	* config/mips/mips.h (MIPS_BRANCH): New macro.
	* config/mips/mips.c (gen_conditional_branch): Use VOIDmode
	for the comparison.  Use gen_condjump.
	(mips_output_conditional_branch): Rework interface to take the
	asm templates for a direct branch and the inverse of a direct branch.
	(mips_output_order_conditional_branch): New function.
	(mips_builtin_branch_and_move): New function.
	(mips_expand_builtin_compare): Use it.  Use VOIDmode for the
	branch condition.  Use gen_single_cc as the condition for
	__builtin_mips_upper_* or __builtin_mips_lower_*.
	(mips_expand_builtin_bposge): Use mips_builtin_branch_and_move.
	Use VOIDmode for the branch condition.
	* config/mips/predicates.md (order_operator): New predicate.
	* config/mips/mips.md (UNSPEC_SINGLE_CC): New constant.
	(branch_fp): Rename to...
	(*branch_fp): ...this.  Remove mode from comparison operator.
	Use new mips_output_conditional_branch interface.
	(branch_fp_inverted): Rename to...
	(*branch_fp_inverted): ...this and update as for *branch_fp.
	(*branch_zero<mode>): Rename to...
	(*branch_order<mode>): ...this.  Remove mode from comparison operator.
	Use mips_output_order_conditional_branch.  Only accept ordered
	comparisons.  
	(*branch_zero<mode>_inverted): Rename to...
	(*branch_order<mode>_inverted): ...this and update as for
	*branch_order<mode>.
	(*branch_equality<mode>): Accept zero as the second operand to
	the equality operator.  Use the new mips_output_conditional_branch
	interface.
	(*branch_equality<mode>_inverted): Likewise.
	(condjump): New expander.
	* config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison
	operator.
	* config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise.
	(bc1any2t, bc1any2f): Likewise.
	(single_cc): New expander.
	(*branch_upper_lower, *branch_upper_lower_inverted): New patterns.

From-SVN: r111909
2006-03-09 21:03:17 +00:00
James E Wilson 4dbdb06186 Add long_call attribute to mips port.
* config/mips/mips.c (mips_encode_section_info, mips_attribute_table,
TARGET_ENCODE_SECTION_INFO, TARGET_ATTRIBUTE_TABLE): New.
* config/mips/mips.h (SYMBOL_FLAG_LONG_CALL, SYMBOL_REF_LONG_CALL_P):
New.
* config/mips/predicates.md (const_call_insn_operand): Add check for
SYMBOL_REF_LONG_CALL_P.
* doc/extend.texi (long_call): Document the new attribute.

From-SVN: r102646
2005-08-01 15:25:52 -07:00
Chao-ying Fu 118ea79312 mips-dsp.md: New file.
* config/mips/mips-dsp.md: New file.
	* config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes.
	* config/mips/mips.c (mips_function_type): Add types for DSP builtin
	functions.
	(mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and
	MIPS_BUILTIN_BPOSGE32.
	(mips_expand_builtin_direct): Add one parameter to indicate that
	builtin functions need to return a value.
	(mips_expand_builtin_bposge): New for expanding "bposge" builtin
	functions.
	(mips_regno_to_class): Add classes for 12 new DSP registers.
	(mips_subword): Change to check four HI registers.
	(mips_output_move): Output move to and from 6 new DSP accumulators.
	(override_options): Make sure -mdsp and -mips16 are not used together.
	Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS.  Enable DSP accumulators
	for machine modes.
	(mips_conditional_register_usage): Disable 6 new DSP accumulators
	when !TARGET_DSP.
	(print_operand): Add 'q' for printing DSP accumulators.
	(mips_cannot_change_mode_class): Check ACC_REGS.
	(mips_secondary_reload_class): Check ACC_REGS.
	(mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP.
	(mips_register_move_cost): Check ACC_REGS.
	(CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph)
	(CODE_FOR_mips_subu_qb): New code-aliasing macros.
	(DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros.
	(dsp_bdesc): New array.
	(bdesc_arrays): Add DSP builtin function table.
	(mips_prepare_builtin_arg): Check predicate again after
	copy_to_mode_reg.
	(mips_expand_builtin): Add one more parameter to
	mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and
	MIPS_BUILTIN_BPOSGE32.
	(mips_init_builtins): Initialize new function types.
	(mips_expand_builtin_direct): Check if builtin functions need to
	return a value and pass operands properly.
	(mips_expand_builtin_bposge): New function.
	* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp.
	(ASM_SPEC): Map -mdsp to -mdsp in GAS.
	(FIRST_PSEUDO_REGISTER): Increase to 188.
	(FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS):
	Update for 12 new DSP registers.
	(DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM)
	(AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM):
	(DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros.
	(reg_class): Add DSP_ACC_REGS and ACC_REGS.
	(REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS.
	(REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS.
	(REG_ALLOC_ORDER): Update for 12 new DSP registers.
	(mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS.
	(UIMM6_OPERAND, IMM10_OPERAND): New macros.
	(EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints.
	(REGISTER_NAMES): Add names for 12 new DSP registers.
	* config/mips/mips.md: Include mips-dsp.md.
	(UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC)
	(UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S)
	(UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W)
	(UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR)
	(UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA)
	(UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR)
	(UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL)
	(UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R)
	(UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH)
	(UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL)
	(UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR)
	(UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH)
	(UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL)
	(UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR)
	(UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH)
	(UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB)
	(UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH)
	(UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H)
	(UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP)
	(UNSPEC_RDDSP): New constants.
	(*movdi_32bit): Change 'x' to 'a' for ACC_REGS.
	(*movsi_internal): Change 'x' to 'a' for ACC_REGS.  Add an
	A<-d alternative.
	* config/mips/mips.opt (-mdsp): New option.
	* config/mips/predicates.md (const_uimm6_operand, const_imm10_operand)
	(reg_imm10_operand): New predicates.
	* doc/extend.texi (MIPS DSP Built-in Functions): New section.
	* doc/invoke.texi (-mdsp): Document new option.

From-SVN: r102307
2005-07-23 08:36:54 +00:00
R. Kelley Cook 39d14ddaac Update FSF address.
From-SVN: r101314
2005-06-25 01:22:41 +00:00
Eric Christopher e0073ed785 predicates.md: Revert previous patch.
2005-06-07  Eric Christopher  <echristo@redhat.com>

        * config/mips/predicates.md: Revert previous patch.

From-SVN: r100726
2005-06-07 22:17:31 +00:00
Eric Christopher f11480cc82 predicates.md (sleu_operand): Use IN_RANGE to specify range of operand.
2005-06-07  Eric Christopher  <echristo@redhat.com>

	* config/mips/predicates.md (sleu_operand): Use
	IN_RANGE to specify range of operand.

From-SVN: r100716
2005-06-07 19:09:34 +00:00
Richard Sandiford b331525311 7000.md (rm7_impy_si_mult): Just match imul and imadd.
* config/mips/7000.md (rm7_impy_si_mult): Just match imul and imadd.
	Remove hilo_operand check.
	(rm7_impy_si_mul): Just match imul3.  Remove hilo_operand check.
	* config/mips/predicates.md (hilo_operand): Delete.

From-SVN: r99592
2005-05-11 20:03:39 +00:00
Chao-ying Fu 06a4ab7022 mips-modes.def (V2SF, CCV2, CCV4): New modes.
2004-08-29  Chao-ying Fu  <fu@mips.com>
	    James E Wilson  <wilson@specifixinc.com>

	* config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2
	8 byte size and alignment.  Give CCV4 16 byte size and alignment.
	* config/mips/mips-ps-3d.md: New file.
	* config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P,
	TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
	(mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE.
	(mips_output_move): Emit "mov.ps" for V2SFmode.
	(mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and
	MODE_VECTOR_FLOAT.
	(override_options): Check if TARGET_MIPS3D and there was an explicit
	!TARGET_PAIRED_SINGLE_FLOAT.  Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D.
	Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when
	TARGET_PAIRED_SINGLE_FLOAT is true.  Check if the ISA supports
	TARGET_PAIRED_SINGLE_FLOAT.  Allow MODE_VECTOR_FLOAT in fp registers,
	and allow CCV2 and CCV4 to occupy two and four CC registers.
	(print_fcc_operand): New function.
	(print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC.  Modify
	%Z to call print_fcc_operand.
	(mips_function_value): Handle MODE_VECTOR_FLOAT.
	(mips_class_max_nregs): Check for ST_REGS, and handle CCmodes.
	(mips_vector_mode_supported_p): New function.
	(mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes.
	(builtin_description): New struct.
	(mips_bdesc): New array of struct builtin_description.
	(mips_expand_builtin, mips_init_builtins,
	mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin,
	mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New
	functions.
	* config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines.
	(TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines.
	(TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float.
	(TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single",
	"-mips3d", and "-mno-mips3d".
	(ASM_SPEC): Map -mips3d to -mips3d in gas.
	(EXTRA_CONSTRAINT_Y): New macro.
	(EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT.  Add new
	multi-letter constraint 'Y'.
	(CONSTRAINT_LEN): New macro.
	(enum mips_builtins): New for MIPS builtin functions.
	(enum mips_function_type): New for the types of MIPS builtin functions.
	(enum mips_cmp_choice): New for the MIPS comparison builtin functions.
	* config/mips/mips.md: New constants for paired single and MIPS-3D
	instructions.  Include the new mips-ps-3d.md file.
	(addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf,
	movv2sf_hardfloat_64bit): New named patterns.
	(madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf,
	nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si,
	sdxc1_v2sf_di): New unnamed patterns.
	* config/mips/predicates.md (const_0_operand, const_1_operand): Add
	const_vector support.
	(const_0_or_1_operand): New predicate.
	* doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d.

Co-Authored-By: James E Wilson <wilson@specifixinc.com>

From-SVN: r86713
2004-08-29 09:19:34 +00:00
Richard Sandiford cf1d880b5f * config/mips/predicates.md (small_data_pattern): Match prefetches.
From-SVN: r86518
2004-08-24 20:53:32 +00:00
Richard Sandiford 96a30b1826 * config/mips/mips-protos.h (mips_symbolic_constant_p)
(mips_atomic_symbolic_constant_p, mips_stack_address_p)
	(mips_small_data_pattern_p): Declare.
	* config/mips/mips.h (CONST_GP_P): Moved from mips.c.
	(PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete.
	* config/mips/mips.c (mips_symbolic_constant_p): Make global.
	(mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions.
	(uns_arith_operand, const_arith_operand, arith_operand, sle_operand)
	(sleu_operand, small_int, reg_or_0_operand, const_float_1_operand)
	(reg_or_const_float_1_operand, hilo_operand, extend_operator)
	(macc_msac_operand, equality_op, cmp_op, trap_cmp_op)
	(pc_or_label_operand, call_insn_operand, move_operand)
	(consttable_operand, symbolic_operand, general_symbolic_operand)
	(global_got_operand, local_got_operand, stack_operand)
	(fp_register_operand, lo_operand, fcc_register_operand): Delete.
	(mips_small_data_pattern_1): Renamed from small_data_pattern_1.
	(mips_small_data_pattern_p): Replace previous small_data_pattern
	predicate.  Turn into a bool () (rtx) function.
	* config/mips/predicates.md: New file.
	* config/mips/mips.md: Include it.  Use the target-independent
	comparison_operator instead of cmp_op.  Rename trap_cmp_op to
	trap_comparison_operator and equality_op to equality_operator.
	Replace uses of small_int with the equivalent const_arith_operand.
	Rename reg_or_const_float_1_operand to reg_or_1_operand.  Rename
	const_float_1_operand to const_1_operand.  Rename fcc_register_operand
	to fcc_reload_operand.
	* config/mips/sb1.md: Rename fp_register_operand to fpr_operand.

From-SVN: r86006
2004-08-14 20:55:56 +00:00