Commit Graph

253 Commits

Author SHA1 Message Date
Richard Sandiford 180bde4f78 sh.c (calc_live_regs): Update check for PIC liveness in compact code.
* config/sh/sh.c (calc_live_regs): Update check for PIC liveness
	in compact code.

From-SVN: r59212
2002-11-18 12:35:15 +00:00
Daniel Jacobowitz d2b2c7cd3d sh.c (gen_shl_and): Don't create a zero_extend if the operand is not an arith_reg_operand.
* sh.c (gen_shl_and): Don't create a zero_extend if the operand
	is not an arith_reg_operand.

From-SVN: r59201
2002-11-17 22:33:31 +00:00
Aldy Hernandez cff9f8d509 hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New.
2002-11-04  Aldy Hernandez  <aldyh@redhat.com>

	* hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New.

	* config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove.
	(CLASS_CANNOT_CHANGE_MODE): Remove.
	(CANNOT_CHANGE_MODE_CLASS): New.

	* config/alpha/alpha.h: Same.

	* config/ia64/ia64.h: Same.

	* config/mips/mips.h: Same.

	* config/s390/s390.h: Same.

	* config/sh/sh.h: Same.

	* config/pa/pa64-regs.h: Same.

	* config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype.

	* config/sh/sh.c (sh_cannot_change_mode_class): New.

	* config/mips/mips-protos.h (mips_cannot_change_mode_class): Add
	prototype.

	* config/mips/mips.c (mips_cannot_change_mode_class): New.

	* doc/tm.texi (Register Classes): Remove
	CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P.
	Document CANNOT_CHANGE_MODE_CLASS.

	* reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS.
	(push_reload): Same.

	* simplify-rtx.c (simplify_subreg): Same.

	* reload1.c (choose_reload_regs): Same.

	* recog.c (register_operand): Same.

	* regrename.c (mode_change_ok): Change to use new
	CANNOT_CHANGE_MODE_CLASS infrastructure.

	* regclass.c (cannot_change_mode_set_regs): New.
	Declare subregs_of_mode.
	(regclass): Use subregs_of_mode.
	Remove references to reg_changes_mode.
	(init_reg_sets_1): Remove class_can_change_mode and
	reg_changes_mode code.
	(invalid_mode_change_p): New.
	(dump_regclass): Use invalid_mode_change_p instead of
	class_can_change_mode.
	(regclass): Same.
	(record_operand_costs): Do not set reg_changes_mode.

	* local-alloc.c (struct qty): Remove changes_mode field.
	(alloc_qty): Remove changes_mode initialization.
	(update_qty_class): Remove set of changes_mode.
	(find_free_reg): Use subregs_of_mode.

	* global.c (find_reg): Use subregs_of_mode info.

	* rtl.h (cannot_change_mode_set_regs): New prototype.
	(invalid_mode_change_p): Same.
	(REG_CANNOT_CHANGE_MODE_P): New macro.

	* flow.c (mark_used_regs): Calculate subregs_of_mode.  Remove
	REG_CHANGES_MODE.
	(life_analysis): Clear subregs_of_mode.

	* combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P.
	Remove use of CLASS_CANNOT_CHANGE_MODE.
	(simplify_set): Same.
	(gen_lowpart_for_combine): Calculate subregs_of_mode.  Remove
	REG_CHANGES_MODE.

	* regs.h: Add extern for subregs_of_mode;
	Include hard-reg-set and basic-block.
	(REG_CHANGES_MODE): Delete.

From-SVN: r58794
2002-11-04 16:58:39 +00:00
J"orn Rennecke ff881d5229 sh.h (binary_logical_operator): Declare.
* sh.h (binary_logical_operator): Declare.
	* sh.c (binary_logical_operator): New function.
	* sh.md (xordi3+1): New combiner splitter pattern.

From-SVN: r58675
2002-10-31 12:53:06 +00:00
Kazu Hirata 5e7a8ee032 s390.c: Follow spelling convention.
* config/s390/s390.c: Follow spelling convention.
	* config/sh/lib1funcs.asm: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sparc/sparc.h: Likewise.
	* config/sparc/sparc.md: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/stormy16/stormy16.h: Likewise.
	* config/v850/v850.c: Likewise.
	* config/v850/v850.h: Likewise.
	* config/vax/vax.c: Likewise.
	* config/vax/vax.h: Likewise.

From-SVN: r57276
2002-09-18 11:43:45 +00:00
Kazu Hirata a920aefe8d fr30.h: Fix comment typos.
* config/fr30/fr30.h: Fix comment typos.
	* config/frv/frv.c: Likewise.
	* config/i386/xmmintrin.h: Likewise.
	* config/mips/mips.c: Likewise.
	* config/sh/sh.c: Likewise.

From-SVN: r57144
2002-09-14 13:39:55 +00:00
Kazu Hirata 88cad84baf haifa-sched.c: Follow spelling conventions.
* haifa-sched.c: Follow spelling conventions.
	* regclass.c: Likewise.
	* regrename.c: Likewise.
	* config/fp-bit.c: Likewise.
	* config/frv/frv.h: Likewise.
	* config/m88k/m88k.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/gnu.h: Likewise.
	* config/rs6000/linux.h: Likewise.
	* config/rs6000/linux64.h: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rs6000/rs6000.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sparc/ultra1_2.md: Likewise.

From-SVN: r57143
2002-09-14 13:12:56 +00:00
J"orn Rennecke 3578cf6341 sh.c (sh_expand_builtin): Return early if encountering an error_mark for a type.
* sh.c (sh_expand_builtin): Return early if encountering an
	error_mark for a type.

From-SVN: r56844
2002-09-05 16:31:24 +01:00
Richard Henderson 44bb111a78 expr.h (enum block_op_methods): New.
* expr.h (enum block_op_methods): New.
        (emit_block_move): Update prototype.
        * expr.c (block_move_libcall_safe_for_call_parm): New.
        (emit_block_move_via_loop): New.
        (emit_block_move): Use them.  New argument METHOD.
        (emit_push_insn): Always respect the given alignment.
        (expand_assignment): Update call to emit_block_move.
        (store_expr, store_field, expand_expr): Likewise.
        * builtins.c (expand_builtin_apply): Likewise.
        (expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
        * function.c (expand_function_end): Likewise.
        * config/sh/sh.c (sh_initialize_trampoline): Likewise.
        * config/sparc/sparc.c (sparc_va_arg): Likewise.
        * calls.c (expand_call, emit_library_call_value_1): Likewise.
        (save_fixed_argument_area): Use emit_block_move with
        BLOCK_OP_CALL_PARM instead of move_by_pieces.
        (restore_fixed_argument_area): Likewise.
        (store_one_arg): Fix alignment parameter to emit_push_insn.

From-SVN: r56661
2002-08-29 12:20:01 -07:00
J"orn Rennecke 58ab7171be sh.c (calc_live_regs): Save FPSCR_REG in an interrupt handler if it is ever live.
* sh.c (calc_live_regs): Save FPSCR_REG in an interrupt handler
	if it is ever live.

	* sh.c (sh_handle_interrupt_handler_attribute): Reject interrupt_handler
	attribute for SHCOMPACT.

	* sh.h (OVERRIDE_OPTIONS): If align_function isn't set, set it
	appropriately.
	(FUNCTION_BOUNDARY): Specify only the minimum alignment required
	by the ABI.

	* sh.h (SH5_WOULD_BE_PARTIAL_NREGS): Also handle TImode case.

From-SVN: r56637
2002-08-28 18:37:54 +01:00
J"orn Rennecke c49439f112 Scheduling revamp:
* sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp,
	mac_gp ftrc_s and cwb.  Add / Adjust definitions in individual insn
	accordingly.
	(attribute insn_class): Provide default definitions based on type.
	Remove all insn-specific settings.
	(various function units): Remove old SH4 scheduling.
	(branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load):
	New attributes.  Set them where appropriate.
	(cpu unit FS): Don't define / use.
	(F3, load_store): New cpu units.
	(F01): New reservation.
	(all insn_reservations): Make dependent on sh4 pipeline model.
	Fix latencies.
	(nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations.
	(sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise.
	(mt insn_reservation): Use type mt_group.
	(insn_reservation load_store): Split into sh4_load, sh4_load_si,
	sh4_fload and sh4_store.
	(insn_reservation branch_zero and branch): Replace with sh4_branch.
	(insn_reservation branch_far): Replace with sh4_return.
	(insn_reservation return_from_exp): Rename to:
	(sh4_return_from_exp).  Change to be just d_lock*5.
	(insn_reservation lds_to_pr): Rename to:
	(sh4_lds_to_pr).  Change to be just d_lock*2.
	(insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just
	d_lock*2.
	(insn_reservation prload_mem): Rename to:
	(sh4_prstore_mem).  Change to d_lock*2,nothing,memory.
	(insn_reservation fpscr_store): Rename to:
	(fpscr_load).  Change to d_lock,nothing,F1*3.
	(insn_reservation fpscr_store_mem): Rename to:
	(fpscr_load_mem).  Change to d_lock,nothing,(F1+memory),F1*2.
	(insn_reservation multi): Change to
	d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2.
	(insn_reservation fp_arith): Change to issue,F01,F2.
	(insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2.
	(insn_reservation dp_float): Change to issue,F01,F1+F2,F2.
	(insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2.
	(insn_reservation fp_double_cmp): Change to
	d_lock,(d_lock+F01),F1+F2,F2.
	(insn_reservation dp_div): Change to
	issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2.
	* sh.c (flow_dependent_p, flow_dependent_p_1): New functions.
	(sh_adjust_cost, SHcompact): Differentiate between different
	kinds of dependencies.  Drop factor of ten for superscalar.
	Use new instruction types.  Add new exception rules.

Two small bug fixes:
	* sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note.

	* sh.md (mperm_w): Add DONE.

From-SVN: r56601
2002-08-27 16:31:02 +01:00
J"orn Rennecke 8202c8c4e9 sh.c (sh_init_builtins): Add PARAMS to declaration.
* sh.c (sh_init_builtins): Add PARAMS to declaration.
	(sh_media_init_builtins, sh_expand_builtin): Likewise.
	(sh_expand_unop_v2sf): Use PARAMS for variable declaration.
	(sh_expand_binop_v2sf): Likewise.
	* sh-protos.h (sh_expand_unop_v2sf): Add PARAMS to declaration.
	(sh_expand_binop_v2sf, sh_cfun_interrupt_handler_p): Likewise.
	(sh_initialize_trampoline): Likewise.

From-SVN: r56259
2002-08-13 17:52:27 +01:00
Kaveh R. Ghazi ab2877a39b arc.c (arc_init): Don't use ISO C style function definitions.
* arc.c (arc_init): Don't use ISO C style function definitions.
	* arm.c (count_insns_for_constant, thumb_far_jump_used_p,
	arm_get_strip_length, arm_strip_name_encoding): Likewise.
	* avr.h (progmem_section): Likewise.
	* h8300.c h8300_asm_insn_count): Likewise.
	* m32r.c (init_idents): Likewise.
	* s390.c (s390_split_branches, s390_chunkify_pool): Likewise.
	* sh.c (sh_cfun_interrupt_handler_p): Likewise.
	* xtensa.c (xtensa_build_va_list): Likewise.

From-SVN: r56209
2002-08-11 18:48:52 +00:00
Stephen Clarke 5615d8fd50 sh.c (prepare_move_operands): Only call target_reg_operand if TARGET_SHMEDIA.
2002-08-08  Stephen Clarke <stephen.clarke@superh.com>

	* config/sh/sh.c (prepare_move_operands): Only call
	target_reg_operand if TARGET_SHMEDIA.

From-SVN: r56139
2002-08-08 22:57:52 +01:00
J"orn Rennecke c608a68464 sh.md (cond_delay_slot): New attribute.
* sh.md (cond_delay_slot): New attribute.
	(cbranch delay): Use it for anulled-true case.
	(stuff_delay_slot): New pattern.
	* sh.c (print_operand, case '.'): Don't print .s / /s fore zero-length
	delay slot insn.
	(gen_far_branch): Emit stuff_delay_slot pattern.

From-SVN: r55878
2002-07-30 18:39:27 +01:00
J"orn Rennecke e69d142219 sh-protos.h (sh_expand_unop_v2sf): Move inside #ifdef RTX_CODE guard.
* sh-protos.h (sh_expand_unop_v2sf): Move inside #ifdef RTX_CODE guard.
	(sh_expand_binop_v2sf): Likewise.
	* sh.c (machine_dependent_reorg): Add move for UNSPEC_MOVA.
	(int_gpr_dest, trunc_hi_operand): New functions.
	* sh.h (PREDICATE_CODES): Add any_register_operand, int_gpr_dest and
	trunc_hi_operand.
	(SPECIAL_MODE_PREDICATES, any_register_operand): Define.
	* sh.md (cmpeqdi_t+1): Remove comments that genrecog warns about.
	(adddi3_compact+1, subdi3_compact+1, ashlsi3_n+1, ashlhi3+1): Likewise.
	(ashrsi2_16+1, ashrsi2_31+1, lshrsi3_n+1, ashrdi3+[12]): Likewise.
	(and_shl_scratch+[12], zero_extendhidi2+1): Likewise.
	(zero_extendhisi2_media+1, extendhidi2+1, extendqidi2+1): Likewise.
	(extendhisi2_media+1, extendqisi2_media+1): Likewise.
	(movsi_media_nofpu+[12], movhi_media+1, movdi_media_nofpu+1): Likewise.
	(movdi_const_16bit+[12], movdf_i4+[123], reload_outdf+[2-5]): Likewise.
	(movsf_ie+1): Likewise.
	(loaddi_trunc): Use int_gpr_dest predicate.
	(use_sfunc_addr, indirect_jump_scratch, sibcall_compact): Add mode(s).
	(mova, mova_const, GOTaddr2picreg, ptrel, casesi_worker_0): Likewise.
	(casesi_worker_0+[12], casesi_worker): Likewise.
	(shcompact_preserve_incoming_args): Likewise.
	(mov_nop): Use any_register_operand predicate.
	(mperm_w0): Use trunc_hi_operand predicate.

From-SVN: r55564
2002-07-18 20:26:07 +01:00
J"orn Rennecke d042370eb0 sh.c (barrier_align, push): Shut up compiler warnings.
* sh.c (barrier_align, push): Shut up compiler warnings.
	(initial_elimination_offset,sh_media_init_builtins): Likewise.
	(reg_no_subreg_operand): Delete.

From-SVN: r55555
2002-07-18 13:47:34 +01:00
J"orn Rennecke ca903bba77 lib1funcs.asm (init_trampoline): New entry point.
* config/sh/lib1funcs.asm (init_trampoline): New entry point.
	* sh-protos.h (sh_initialize_trampoline): Declare.
	* sh.c (sh_initialize_trampoline): New function.
	* sh.h (TRAMPOLINE_SIZE): Only 24 for TARGET_SHMEDIA32.
	(TRAMPOLINE_ALIGNMENT): Need cache-line alignment for TARGET_SHMEDIA.
	(INITIALIZE_TRAMPOLINE): Call sh_initialize_trampoline.
	(TRAMPOLINE_ADJUST_ADDRESS): Not needed for SHcompact.
	* sh.md (initialize_trampoline, double_shori): New patterns.
	(initialize_trampoline_compact): Likewise.
	(shmedia32_initialize_trampoline_big): Remove.
	(shmedia32_initialize_trampoline_little): Likewise.

From-SVN: r55529
2002-07-17 16:43:18 +01:00
J"orn Rennecke 0ac785173d sh-protos.h (binary_float_operator): Remove declaration.
* sh-protos.h (binary_float_operator): Remove declaration.
	(sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare.
	* sh.c (print_operand, case 'N'): Check against CONST0_RTX.
	(unary_float_operator, sh_expand_unop_v2sf): New functions.
	(sh_expand_binop_v2sf): Likewise.
	(zero_vec_operand): Delete.
	(SH_BLTIN_UDI): New builtin shared signature define.  Renumbered
	all non-shared ones.
	(bdesc): Change all the mextr builtins to use SH_BLTIN_UDI.
	Enable nsb and byterev.
	* sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS.
	(HARD_REGNO_MODE_OK): Allow TImode in fp regs.  Allow V2SFmode
	in general regs.
	(enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS.
	(SECONDARY_OUTPUT_RELOAD_CLASS): Likewise.  Remove clause for
	immediate operands.
	(SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands.
	Add DF_HI_REGS.
	(CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow
	lowpart fp regs - only for big endian for now.
	(LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors
	when FPU is in use.
	(EXTRA_CONTRAINT_U): Check against CONST0_RTX.
	(LOAD_EXTEND_OP): NIL for SImode.
	(REGISTER_MOVE_COST): Add DF_HI_REGS.  Const for moves between
	general and fp registers is 4.
	PREDICATE_CODES: Amend binary_float_operator entry.
	Remove zero_vec_operand.  Add unary_float_operator.
	* sh.md (udivsi3_i4_media): Use truncate instead of paradoxical
	subreg SET_DEST.
	(truncdisi2, truncdihi2, movv2sf): Allow memory destinations.
	(truncdiqi2): Do sign extension.
	(movsi_media, movdi_media): Allow to use r63 to an fp register.
	(movdf_media, movsf_media): Likewise.
	(movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS.
	Collapse to one define_insn_and_split.  Allow immediate sources.
	(addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns.
	(movv4sf_i): Allow immediate sources.  Use simplify_gen_subreg.
	(movv4sf): Allow immediate sources.
	(movsf_media_nofpu+1): Don't split moves to FP registers.
	(unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns.
	(movv8qi_i+3): Check against CONST0_RTX.
	(mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode
	for input and output operands.  Fix argument 3 to gen_mextr_rl.
	(mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/
	(msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise.
	(mshf0_w, fipr, ftrv): Likewise.
	(mshfhi_l_di): Now insn_and_split.  Can handle FP regs.

From-SVN: r55528
2002-07-17 16:15:04 +01:00
Zack Weinberg e5faf155c9 builtins.c (std_expand_builtin_va_start): Remove unused first argument.
* builtins.c (std_expand_builtin_va_start): Remove unused
	first argument.
	(expand_builtin_va_start): Call EXPAND_BUILTIN_VA_START and
	std_expand_builtin_va_start with just two arguments.
	* expr.h: Update prototypes.

	* alpha-protos.h, alpha.h, alpha.c, arc-protos.h, arc.h,
	arc.c, d30v-protos.h, d30v.h, d30v.c, i386-protos.h, i386.h,
	i386.c, i960-protos.h, i960.h, i960.c, m88k-protos.h, m88k.h,
	m88k.c, mips-protos.h, mips.h, mips.c, mn10300-protos.h,
	mn10300.h, mn10300.c, pa-protos.h, pa.h, pa.c,
	rs6000-protos.h, rs6000.h, rs6000.c, s390-protos.h, s390.h,
	s390.c, sh-protos.h, sh.h, sh.c, sparc-protos.h, sparc.h,
	sparc.c, stormy16-protos.h, stormy16.h, stormy16.c,
	xtensa-protos.h, xtensa.h, xtensa.c:  Remove unused first
	argument from all implementations of EXPAND_BUILTIN_VA_START
	and all uses of std_expand_builtin_va_start.

From-SVN: r55495
2002-07-16 20:59:08 +00:00
Zack Weinberg 6c535c69ee varargs.h: Replace with stub which issues #error.
* ginclude/varargs.h: Replace with stub which issues #error.
	* ginclude/stdarg.h: __builtin_stdarg_start is renamed
	__builtin_va_start.

	* builtins.def (BUILT_IN_VARARGS_START): Delete.
	(BUILT_IN_VA_START): New.
	* builtins.c (expand_builtin_va_start): Eliminate first
	argument and code to implement pre-ISO varargs.
	(std_expand_builtin_va_start): Ignore first argument; it is
	always 1.
	(expand_builtin): Handle BUILT_IN_VA_START and
	BUILT_IN_STDARG_START identically.  Delete
	BUILT_IN_VARARGS_START case.

	* function.c (assign_parms): Delete hide_last_arg and all
	its uses.
	(mark_varargs): Delete function.
	* function.h (struct function): Delete 'varargs' bit.
	(current_function_varargs): Delete macro.
	* tree.h: Don't declare mark_varargs.

	* c-decl.c (c_function_varargs, c_mark_varargs): Delete.
	(c_expand_body): Don't call mark_varargs.
	* c-objc-common.c: Handle BUILT_IN_VA_START and
	BUILT_IN_STDARG_START identically.  Delete
	BUILT_IN_VARARGS_START case.
	* c-tree.h: Don't declare c_mark_varargs.
	* c-parse.in: Remove grammar rules for '&...' (which has been
	commented out since before 2.7.2) and for '...' in K+R
	argument declarations.

	* builtins.c, function.c, integrate.c, sibcall.c,
	config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h,
	config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c,
	config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c,
	config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h,
	config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h,
	config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c,
	config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h,
	config/stormy16/stormy16.c: Delete all references to
	current_function_varargs, and code predicated on that flag.

	* config/alpha/alpha.c (alpha_va_start),
	config/arc/arc.c (arc_va_start),
	config/i386/i386.c (ix86_va_start),
	config/mips/mips.c (mips_va_start),
	config/mn10300/mn10300.c (mn10300_va_start),
	config/rs6000/rs6000.c (rs6000_va_start),
	config/s390/s390.c (s390_va_start),
	config/sh/sh.c (sh_va_start),
	Ignore first argument; it is always 1.

	* config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start.
	* config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start.
	* config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c:
	Delete m68hc11_va_start.
	* config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h:
	No need to define EXPAND_BUILTIN_VA_START.

	* doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi,
	doc/trouble.texi: Remove references to GCC-provided <varargs.h>.

testsuite:
	* c-torture/execute/991216-3.c, c-torture/execute/strct-varg-1.c,
	c-torture/execute/va-arg-7.c, c-torture/execute/va-arg-8.c,
	c-torture/execute/va-arg-15.c, c-torture/execute/va-arg-16.c,
	c-torture/execute/va-arg-17.c, c-torture/execute/va-arg-19.c:
	Convert to use <stdarg.h>.
	* c-torture/execute/va-arg-3.c, c-torture/execute/va-arg-3.x:
	Delete.
	* gcc.dg/va-arg-2.c: New.
	* lib/gcc.exp, lib/objc.exp: Remove code to set -DNO_VARARGS.

From-SVN: r55472
2002-07-16 02:16:47 +00:00
Stephen Clarke 2ad65b0e91 sh.c (sh_adjust_cost): Special handling of SHMEDIA code.
Tue Jul  9 22:37:44 2002  Stephen Clarke <stephen.clarke@superh.com>
                          J"orn Rennecke <joern.rennecke@superh.com>

	* sh.c (sh_adjust_cost): Special handling of SHMEDIA code.
	* sh.md (attribute issues): Replace with:
	(attribute pipe_model).  All users changed.
	(attribute type): Change pt / ptabs to pt_media / ptabs_media.
	All users changed.
	(function units sh5issue, sh5fds): New.
	(attribute is_mac_media): New.
	(adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type.
	(andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise.
	(ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise.
	(movhi_media, shori_media, movv2sf_i, jump_media): Likewise.
	(call_media, call_value_media, sibcall_media): Likewise.
	(casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise.
	(return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise.
	(mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise.
	(fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise.
	(cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise.
	(sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise.
	(muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise.
	(fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise.
	(cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise.
	(sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise.
	(truncdfsf2_media): Likewise.
	(movsi_media, movsi_media_nofpu, movdi_media): Use new types.
	(movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise.

Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com>

From-SVN: r55346
2002-07-09 23:04:34 +01:00
J"orn Rennecke b6d3398326 sh.h (PREDICATE_CODES): Add general_extend_operand and inqhi_operand.
* sh.h (PREDICATE_CODES): Add general_extend_operand and inqhi_operand.
	* sh.c (general_extend_operand, inqhi_operand): New functions.
	* sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Collapse
	alternatives using 'N' modifier.  Add type.
	(adddi3z_media): Likewise.  Enable generator function generation.
	(movdicc_false, movdicc_true, addsi3_media, subsi3_media): Use more
	exact predicates / constraints.  Add type.
	(subsi3): Allow 0 for SHMEDIA.
	(udivsi3_i4_media): Use match_operand for input values
	rather than hard registers.
	(udivsi3 - TARGET_SHMEDIA_FPU case): Don't ferry values
	unnecessarily through hard registers.  Keep copies of pseudo
	registers outside of the libcall sequence.
	(mulsidi3_media, umulsidi3_media): Use more exact predicates.  Add type.
	(ashlsi3_media, ashrsi3_media, lshrsi3_media): Likewise.
	(zero_extendsidi2, zero_extendhidi2, zero_extendqidi2): Likewise.
	(extendhidi2, extendqidi2): Likewise.
	(andsi3_compact): Name.
	(andcdi3): Enable generator function generation.
	(zero_extendhisi2, zero_extendqisi2): Rename to
	(zero_extendhisi2_compact, zero_extendqisi2_compact).
	(extendhisi2, extendqisi2): Rename to
	(extendhisi2_compact, extendqisi2_compact).
	(rotldi3, rotldi3_mextr, rotrdi3, rotrdi3_mextr): New patterns.
	(loaddi_trunc, zero_extendhisi2, zero_extendhisi2_media): Likewise.
	(zero_extendhisi2_media+1, zero_extendqisi2): Likewise.
	(zero_extendqisi2_media, extendhisi2, extendhisi2_media): Likewise.
	(extendhisi2_media, extendhisi2_media+1, extendqisi2): Likewise.
	(extendqisi2_media, extendqisi2_media+1, truncdisi2): Likewise.
	(truncdihi2, truncdiqi2, reload_inqi, reload_inhi): Likewise.
	(shmedia32_initialize_trampoline_big): Likewise.
	(shmedia32_initialize_trampoline_little): Likewise.
	(nsb, nsbsi, nsbdi, ffsdi2, ffssi2, byterev): Likewise.
	(negdi2): Remove spurious T clobber.
	(zero_extendhidi2+1, extendhidi2+1, extendqidi2+1): Handle TRUNCATE.
	(movsi_media, movsi_media_nofpu): Remove spurious *k after b.
	(movdi_media, movdi_media_nofpu, pt, ptb): Likewise.
	(movsi_media_nofpu+2, movhi_media+1): Only do split after reload.
	(ic_invalidate_line_media): Write back data cache before invalidating
	instruction cache.  Add type.
	(movsf_media): Sign-extend when the destination is a general
	purpose register.  Add type.
	(bgt_media, bge_media, bgtu_media, bgeu_media, blt_media_i): Allow 0.
	(casesi_worker_0+1): Only increment ref count for proper label.
	(casesi_worker_0+2): Likewise.

From-SVN: r55345
2002-07-09 22:30:32 +01:00
J"orn Rennecke c8cc4417e4 sh.h (PRINT_OPERAND_PUNCT_VALID_P): Allow '\''.
* sh.h (PRINT_OPERAND_PUNCT_VALID_P): Allow '\''.
	(PREDICATE_CODES): Add entries for equality_comparison_operator,
	greater_comparison_operator and less_comparison_operator.
	* sh.c (print_operand): Add '\'' code.  Make 'o' handle
	more operators.
	(equality_comparison_operator): New function.
	(greater_comparison_operator, less_comparison_operator): Likewise.
	* sh.md (beq_media_i): Disable generator function generation.
	Use match_operator to handle a whole class of comparisons.  Add
	modifier in output template to provide branch prediction.  Add type.
	(bgt_media_i, ble_media_i): Likewise.  Allow zero operands.
	(bne_media_i, bge_media_i, bgtu_media_i, bgeu_media_i): Delete.
	(blt_media_i, bleu_media_i, bltu_media_i): Likewise.
	(bgt, blt, ble, bge, bgtu, bltu, bgeu, bleu): Allow zero operands.

From-SVN: r55305
2002-07-07 20:56:31 +01:00
J"orn Rennecke 52702ae16e sh.c (print_operand, case 'N'): Allow zero vector.
Tue Jul  2 18:45:45 2002  J"orn Rennecke <joern.rennecke@superh.com>

	* sh.c (print_operand, case 'N'): Allow zero vector.
	(arith_reg_or_0_operand): Likewise.
	(zero_vec_operand): Check for CONST_VECTOR, not PARALLEL.
	* sh.h (CONST_COSTS): 0 has 0 cost.  Check OUTER_CODE for
	IOR, XOR, PLUS and SET and take their respective constant
	ranges into account.
	(PREDICATE_CODES, arith_reg_or_0_operand): Can be CONST_VECTOR.
	* sh.md (subdi3, subdi3_media): Allow zero operand.
	(movv8qi_i+3): Only vector that is not split is the zero vector.
	Fix operand 3 to simplify_subreg.
	(movv2si_i): Split alternative 1.
	(mshfhi_l_di_rev+1): New splitter.

Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.155
diff -p -r1.155 sh.c
*** config/sh/sh.c	2 Jul 2002 04:01:04 -0000	1.155
--- config/sh/sh.c	2 Jul 2002 17:45:37 -0000
*************** print_operand (stream, x, code)
*** 434,440 ****
        break;

      case 'N':
!       if (x == const0_rtx)
  	{
  	  fprintf ((stream), "r63");
  	  break;
--- 434,441 ----
        break;

      case 'N':
!       if (x == const0_rtx
! 	  || (GET_CODE (x) == CONST_VECTOR && zero_vec_operand (x, VOIDmode)))
  	{
  	  fprintf ((stream), "r63");
  	  break;
*************** arith_reg_or_0_operand (op, mode)
*** 5940,5946 ****
    if (arith_reg_operand (op, mode))
      return 1;

!   if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_N (INTVAL (op)))
      return 1;

    return 0;
--- 5941,5947 ----
    if (arith_reg_operand (op, mode))
      return 1;

!   if (EXTRA_CONSTRAINT_U (op))
      return 1;

    return 0;
*************** zero_vec_operand (v, mode)
*** 6222,6228 ****
  {
    int i;

!   if (GET_CODE (v) != PARALLEL
        || (GET_MODE (v) != mode && mode != VOIDmode))
      return 0;
    for (i = XVECLEN (v, 0) - 1; i >= 0; i--)
--- 6223,6229 ----
  {
    int i;

!   if (GET_CODE (v) != CONST_VECTOR
        || (GET_MODE (v) != mode && mode != VOIDmode))
      return 0;
    for (i = XVECLEN (v, 0) - 1; i >= 0; i--)
Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.154
diff -p -r1.154 sh.h
*** config/sh/sh.h	1 Jul 2002 19:41:53 -0000	1.154
--- config/sh/sh.h	2 Jul 2002 17:45:37 -0000
*************** while (0)
*** 2689,2698 ****
    case CONST_INT:				\
      if (TARGET_SHMEDIA)				\
        {						\
  	if ((OUTER_CODE) == AND && and_operand ((RTX), DImode)) \
  	  return 0;				\
  	if (CONST_OK_FOR_J (INTVAL (RTX)))	\
!           return COSTS_N_INSNS (1);		\
  	else if (CONST_OK_FOR_J (INTVAL (RTX) >> 16)) \
  	  return COSTS_N_INSNS (2);		\
  	else if (CONST_OK_FOR_J ((INTVAL (RTX) >> 16) >> 16)) \
--- 2689,2704 ----
    case CONST_INT:				\
      if (TARGET_SHMEDIA)				\
        {						\
+ 	if (INTVAL (RTX) == 0)			\
+ 	  return 0;				\
  	if ((OUTER_CODE) == AND && and_operand ((RTX), DImode)) \
  	  return 0;				\
+ 	if (((OUTER_CODE) == IOR || (OUTER_CODE) == XOR \
+ 	     || (OUTER_CODE) == PLUS) \
+ 	    && CONST_OK_FOR_P (INTVAL (RTX)))	\
+ 	  return 0;				\
  	if (CONST_OK_FOR_J (INTVAL (RTX)))	\
!           return COSTS_N_INSNS ((OUTER_CODE) != SET);		\
  	else if (CONST_OK_FOR_J (INTVAL (RTX) >> 16)) \
  	  return COSTS_N_INSNS (2);		\
  	else if (CONST_OK_FOR_J ((INTVAL (RTX) >> 16) >> 16)) \
*************** extern int rtx_equal_function_value_matt
*** 3225,3231 ****
    {"arith_operand", {SUBREG, REG, CONST_INT}},				\
    {"arith_reg_dest", {SUBREG, REG}},					\
    {"arith_reg_operand", {SUBREG, REG}},					\
!   {"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT}},			\
    {"binary_float_operator", {PLUS, MULT}},				\
    {"commutative_float_operator", {PLUS, MULT}},				\
    {"extend_reg_operand", {SUBREG, REG, TRUNCATE}},			\
--- 3231,3237 ----
    {"arith_operand", {SUBREG, REG, CONST_INT}},				\
    {"arith_reg_dest", {SUBREG, REG}},					\
    {"arith_reg_operand", {SUBREG, REG}},					\
!   {"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}},	\
    {"binary_float_operator", {PLUS, MULT}},				\
    {"commutative_float_operator", {PLUS, MULT}},				\
    {"extend_reg_operand", {SUBREG, REG, TRUNCATE}},			\
Index: config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.md,v
retrieving revision 1.107
diff -p -r1.107 sh.md
*** config/sh/sh.md	1 Jul 2002 19:41:54 -0000	1.107
--- config/sh/sh.md	2 Jul 2002 17:45:38 -0000
***************
*** 546,552 ****
  ;; There is no way to model this with gcc's function units.  This problem is
  ;; actually mentioned in md.texi.  Tackling this problem requires first that
  ;; it is possible to speak about the target in an open discussion.
! ;;
  ;; However, simple double-precision operations always conflict.

  (define_function_unit "fp"    1 0
--- 546,552 ----
  ;; There is no way to model this with gcc's function units.  This problem is
  ;; actually mentioned in md.texi.  Tackling this problem requires first that
  ;; it is possible to speak about the target in an open discussion.
! ;;
  ;; However, simple double-precision operations always conflict.

  (define_function_unit "fp"    1 0
***************
*** 1048,1054 ****
    "@
  	addz.l	%1, %2, %0
  	addz.l	%1, r63, %0")
!
  (define_insn "adddi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(plus:DI (match_operand:DI 1 "arith_reg_operand" "%0")
--- 1048,1054 ----
    "@
  	addz.l	%1, %2, %0
  	addz.l	%1, r63, %0")
!
  (define_insn "adddi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(plus:DI (match_operand:DI 1 "arith_reg_operand" "%0")
***************
*** 1122,1128 ****
    "@
  	add.l	%1, %2, %0
  	addi.l	%1, %2, %0")
!
  (define_insn "*addsi3_compact"
    [(set (match_operand:SI 0 "arith_reg_operand" "=r")
  	(plus:SI (match_operand:SI 1 "arith_operand" "%0")
--- 1122,1128 ----
    "@
  	add.l	%1, %2, %0
  	addi.l	%1, %2, %0")
!
  (define_insn "*addsi3_compact"
    [(set (match_operand:SI 0 "arith_reg_operand" "=r")
  	(plus:SI (match_operand:SI 1 "arith_operand" "%0")
***************
*** 1138,1162 ****

  (define_expand "subdi3"
    [(set (match_operand:DI 0 "arith_reg_operand" "")
! 	(minus:DI (match_operand:DI 1 "arith_reg_operand" "")
  		  (match_operand:DI 2 "arith_reg_operand" "")))]
    ""
    "
  {
    if (TARGET_SH1)
      {
        emit_insn (gen_subdi3_compact (operands[0], operands[1], operands[2]));
        DONE;
      }
  }")
!
  (define_insn "*subdi3_media"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
! 	(minus:DI (match_operand:DI 1 "arith_reg_operand" "r")
  		  (match_operand:DI 2 "arith_reg_operand" "r")))]
    "TARGET_SHMEDIA"
!   "sub	%1, %2, %0")
!
  (define_insn "subdi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(minus:DI (match_operand:DI 1 "arith_reg_operand" "0")
--- 1138,1163 ----

  (define_expand "subdi3"
    [(set (match_operand:DI 0 "arith_reg_operand" "")
! 	(minus:DI (match_operand:DI 1 "arith_reg_or_0_operand" "")
  		  (match_operand:DI 2 "arith_reg_operand" "")))]
    ""
    "
  {
    if (TARGET_SH1)
      {
+       operands[1] = force_reg (DImode, operands[1]);
        emit_insn (gen_subdi3_compact (operands[0], operands[1], operands[2]));
        DONE;
      }
  }")
!
  (define_insn "*subdi3_media"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
! 	(minus:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rN")
  		  (match_operand:DI 2 "arith_reg_operand" "r")))]
    "TARGET_SHMEDIA"
!   "sub	%N1, %2, %0")
!
  (define_insn "subdi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(minus:DI (match_operand:DI 1 "arith_reg_operand" "0")
***************
*** 1558,1564 ****
  					   : \"__sdivsi3\")));

        if (TARGET_SHMEDIA)
! 	last = gen_divsi3_i1_media (operands[0],
  				    Pmode == DImode
  				    ? operands[3]
  				    : gen_rtx_SUBREG (DImode, operands[3],
--- 1559,1565 ----
  					   : \"__sdivsi3\")));

        if (TARGET_SHMEDIA)
! 	last = gen_divsi3_i1_media (operands[0],
  				    Pmode == DImode
  				    ? operands[3]
  				    : gen_rtx_SUBREG (DImode, operands[3],
***************
*** 1771,1777 ****
  		 (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))]
    "TARGET_SHMEDIA"
    "muls.l	%1, %2, %0")
!
  (define_insn "mulsidi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(mult:DI
--- 1772,1778 ----
  		 (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))]
    "TARGET_SHMEDIA"
    "muls.l	%1, %2, %0")
!
  (define_insn "mulsidi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(mult:DI
***************
*** 1841,1847 ****
  		 (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))]
    "TARGET_SHMEDIA"
    "mulu.l	%1, %2, %0")
!
  (define_insn "umulsidi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(mult:DI
--- 1842,1848 ----
  		 (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r"))))]
    "TARGET_SHMEDIA"
    "mulu.l	%1, %2, %0")
!
  (define_insn "umulsidi3_compact"
    [(set (match_operand:DI 0 "arith_reg_operand" "=r")
  	(mult:DI
***************
*** 3440,3446 ****
     (set_attr "type" "pcload,move,load,store,move,pcload,move,move")])

  ;; If the output is a register and the input is memory or a register, we have
! ;; to be careful and see which word needs to be loaded first.

  (define_split
    [(set (match_operand:DI 0 "general_movdst_operand" "")
--- 3441,3447 ----
     (set_attr "type" "pcload,move,load,store,move,pcload,move,move")])

  ;; If the output is a register and the input is memory or a register, we have
! ;; to be careful and see which word needs to be loaded first.

  (define_split
    [(set (match_operand:DI 0 "general_movdst_operand" "")
***************
*** 4195,4201 ****
  }")

  ;; If the output is a register and the input is memory or a register, we have
! ;; to be careful and see which word needs to be loaded first.

  (define_split
    [(set (match_operand:DF 0 "general_movdst_operand" "")
--- 4196,4202 ----
  }")

  ;; If the output is a register and the input is memory or a register, we have
! ;; to be careful and see which word needs to be loaded first.

  (define_split
    [(set (match_operand:DF 0 "general_movdst_operand" "")
***************
*** 4392,4398 ****
    DONE;
  }"
    [(set_attr "length" "8")])
!
  (define_expand "movv4sf"
    [(set (match_operand:V4SF 0 "nonimmediate_operand" "=f,f,m")
  	(match_operand:V4SF 1 "nonimmediate_operand" "f,m,f"))]
--- 4393,4399 ----
    DONE;
  }"
    [(set_attr "length" "8")])
!
  (define_expand "movv4sf"
    [(set (match_operand:V4SF 0 "nonimmediate_operand" "=f,f,m")
  	(match_operand:V4SF 1 "nonimmediate_operand" "f,m,f"))]
***************
*** 4444,4450 ****
    DONE;
  }"
    [(set_attr "length" "32")])
!
  (define_expand "movv16sf"
    [(set (match_operand:V16SF 0 "nonimmediate_operand" "=f,f,m")
  	(match_operand:V16SF 1 "nonimmediate_operand" "f,m,f"))]
--- 4445,4451 ----
    DONE;
  }"
    [(set_attr "length" "32")])
!
  (define_expand "movv16sf"
    [(set (match_operand:V16SF 0 "nonimmediate_operand" "=f,f,m")
  	(match_operand:V16SF 1 "nonimmediate_operand" "f,m,f"))]
***************
*** 4499,4505 ****
    REAL_VALUE_FROM_CONST_DOUBLE (value, operands[1]);
    REAL_VALUE_TO_TARGET_SINGLE (value, values);
    operands[2] = GEN_INT (values);
!
    operands[3] = gen_rtx_REG (DImode, true_regnum (operands[0]));
  }")

--- 4500,4506 ----
    REAL_VALUE_FROM_CONST_DOUBLE (value, operands[1]);
    REAL_VALUE_TO_TARGET_SINGLE (value, values);
    operands[2] = GEN_INT (values);
!
    operands[3] = gen_rtx_REG (DImode, true_regnum (operands[0]));
  }")

***************
*** 5410,5416 ****
  	  if (! SYMBOL_REF_FLAG (operands[0]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      emit_insn (gen_symGOTPLT2reg (reg, operands[0]));
  	      operands[0] = reg;
  	    }
--- 5411,5417 ----
  	  if (! SYMBOL_REF_FLAG (operands[0]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      emit_insn (gen_symGOTPLT2reg (reg, operands[0]));
  	      operands[0] = reg;
  	    }
***************
*** 5634,5640 ****
  	  if (! SYMBOL_REF_FLAG (operands[1]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      emit_insn (gen_symGOTPLT2reg (reg, operands[1]));
  	      operands[1] = reg;
  	    }
--- 5635,5641 ----
  	  if (! SYMBOL_REF_FLAG (operands[1]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      emit_insn (gen_symGOTPLT2reg (reg, operands[1]));
  	      operands[1] = reg;
  	    }
***************
*** 5841,5847 ****
  	  if (! SYMBOL_REF_FLAG (operands[0]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      /* We must not use GOTPLT for sibcalls, because PIC_REG
  		 must be restored before the PLT code gets to run.  */
  	      emit_insn (gen_symGOT2reg (reg, operands[0]));
--- 5842,5848 ----
  	  if (! SYMBOL_REF_FLAG (operands[0]))
  	    {
  	      rtx reg = gen_reg_rtx (Pmode);
!
  	      /* We must not use GOTPLT for sibcalls, because PIC_REG
  		 must be restored before the PLT code gets to run.  */
  	      emit_insn (gen_symGOT2reg (reg, operands[0]));
***************
*** 6167,6173 ****
     (use (label_ref (match_operand 1 "" "")))]
    "TARGET_SHMEDIA"
    "blink	%0, r63")
!
  ;; Call subroutine returning any type.
  ;; ??? This probably doesn't work.

--- 6168,6174 ----
     (use (label_ref (match_operand 1 "" "")))]
    "TARGET_SHMEDIA"
    "blink	%0, r63")
!
  ;; Call subroutine returning any type.
  ;; ??? This probably doesn't work.

***************
*** 6284,6290 ****
  	tr = gen_rtx_SUBREG (GET_MODE (operands[0]), tr, 0);

        insn = emit_move_insn (operands[0], tr);
!
        REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, equiv,
  					    REG_NOTES (insn));

--- 6285,6291 ----
  	tr = gen_rtx_SUBREG (GET_MODE (operands[0]), tr, 0);

        insn = emit_move_insn (operands[0], tr);
!
        REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, equiv,
  					    REG_NOTES (insn));

***************
*** 6370,6379 ****
    if (TARGET_SHMEDIA)
      {
        rtx reg = operands[2];
!
        if (GET_MODE (reg) != DImode)
  	reg = gen_rtx_SUBREG (DImode, reg, 0);
!
        if (flag_pic > 1)
  	emit_insn (gen_movdi_const_32bit (reg, operands[1]));
        else
--- 6371,6380 ----
    if (TARGET_SHMEDIA)
      {
        rtx reg = operands[2];
!
        if (GET_MODE (reg) != DImode)
  	reg = gen_rtx_SUBREG (DImode, reg, 0);
!
        if (flag_pic > 1)
  	emit_insn (gen_movdi_const_32bit (reg, operands[1]));
        else
***************
*** 6391,6397 ****
    REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, XVECEXP (XEXP (operands[1],
  								  0), 0, 0),
  					REG_NOTES (insn));
!
    DONE;
  }")

--- 6392,6398 ----
    REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, XVECEXP (XEXP (operands[1],
  								  0), 0, 0),
  					REG_NOTES (insn));
!
    DONE;
  }")

***************
*** 7231,7237 ****
  				    (match_dup 2))))
  	      (set (reg:SI T_REG)
  		   (ne:SI (ior:SI (match_dup 1) (match_dup 2))
! 			  (const_int 0)))])]
    ""
    "
  {
--- 7232,7238 ----
  				    (match_dup 2))))
  	      (set (reg:SI T_REG)
  		   (ne:SI (ior:SI (match_dup 1) (match_dup 2))
! 			  (const_int 0)))])]
    ""
    "
  {
***************
*** 7282,7288 ****
  				    (match_dup 2))))
  	      (set (reg:SI T_REG)
  		   (ne:SI (ior:SI (match_operand 1 "" "") (match_dup 2))
! 			  (const_int 0)))])]
    "TARGET_SH1"
    "operands[2] = gen_reg_rtx (SImode);")

--- 7283,7289 ----
  				    (match_dup 2))))
  	      (set (reg:SI T_REG)
  		   (ne:SI (ior:SI (match_operand 1 "" "") (match_dup 2))
! 			  (const_int 0)))])]
    "TARGET_SH1"
    "operands[2] = gen_reg_rtx (SImode);")

***************
*** 8279,8285 ****
  ;;   "#"
  ;;   [(set_attr "length" "4")
  ;;    (set_attr "fp_mode" "double")])
! ;;
  ;; (define_split
  ;;   [(set (match_operand:SI 0 "arith_reg_operand" "=r")
  ;; 	(fix:SI (match_operand:DF 1 "arith_reg_operand" "f")))
--- 8280,8286 ----
  ;;   "#"
  ;;   [(set_attr "length" "4")
  ;;    (set_attr "fp_mode" "double")])
! ;;
  ;; (define_split
  ;;   [(set (match_operand:SI 0 "arith_reg_operand" "=r")
  ;; 	(fix:SI (match_operand:DF 1 "arith_reg_operand" "f")))
***************
*** 8320,8326 ****
    "* return output_ieee_ccmpeq (insn, operands);"
    [(set_attr "length" "4")
     (set_attr "fp_mode" "double")])
!
  (define_insn "cmpeqdf_media"
    [(set (match_operand:DI 0 "register_operand" "=r")
  	(eq:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
--- 8321,8327 ----
    "* return output_ieee_ccmpeq (insn, operands);"
    [(set_attr "length" "4")
     (set_attr "fp_mode" "double")])
!
  (define_insn "cmpeqdf_media"
    [(set (match_operand:DI 0 "register_operand" "=r")
  	(eq:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
***************
*** 8806,8815 ****
    "TARGET_SHMEDIA && reload_completed
     && GET_MODE (operands[0]) == GET_MODE (operands[1])
     && VECTOR_MODE_SUPPORTED_P (GET_MODE (operands[0]))
!    && XVECEXP (operands[1], 0, 0) != const0_rtx
!    && (HOST_BITS_PER_WIDE_INT >= 64
!        || HOST_BITS_PER_WIDE_INT >= GET_MODE_BITSIZE (GET_MODE (operands[0]))
!        || sh_1el_vec (operands[1], VOIDmode))"
    [(set (match_dup 0) (match_dup 1))]
    "
  {
--- 8807,8813 ----
    "TARGET_SHMEDIA && reload_completed
     && GET_MODE (operands[0]) == GET_MODE (operands[1])
     && VECTOR_MODE_SUPPORTED_P (GET_MODE (operands[0]))
!    && ! zero_vec_operand (operands[1], VOIDmode)"
    [(set (match_dup 0) (match_dup 1))]
    "
  {
***************
*** 8819,8825 ****

    operands[0] = gen_rtx_REG (new_mode, true_regnum (operands[0]));
    operands[1]
!     = simplify_subreg (new_mode, operands[1], GET_MODE (operands[0]), 0);
  }")

  (define_expand "movv2hi"
--- 8817,8823 ----

    operands[0] = gen_rtx_REG (new_mode, true_regnum (operands[0]));
    operands[1]
!     = simplify_subreg (new_mode, operands[1], GET_MODE (operands[1]), 0);
  }")

  (define_expand "movv2hi"
***************
*** 8878,8884 ****
         || register_operand (operands[1], V2SImode))"
    "@
  	add	%1, r63, %0
! 	movi	%1, %0
  	#
  	ld%M1.q	%m1, %0
  	st%M0.q	%m0, %1"
--- 8876,8882 ----
         || register_operand (operands[1], V2SImode))"
    "@
  	add	%1, r63, %0
! 	#
  	#
  	ld%M1.q	%m1, %0
  	st%M0.q	%m0, %1"
***************
*** 9641,9647 ****
  /* These are useful to expand ANDs and as combiner patterns.  */
  (define_insn "mshfhi_l_di"
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")
! 	(ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
                               (const_int 32))
  		(and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
  			(const_int -4294967296))))]
--- 9639,9645 ----
  /* These are useful to expand ANDs and as combiner patterns.  */
  (define_insn "mshfhi_l_di"
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")
! 	(ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
                               (const_int 32))
  		(and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
  			(const_int -4294967296))))]
***************
*** 9653,9663 ****
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")
  	(ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
  			(const_int -4294967296))
! 		(lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
                               (const_int 32))))]
    "TARGET_SHMEDIA"
    "mshfhi.l	%N2, %N1, %0"
    [(set_attr "type" "arith_media")])

  (define_insn "mshflo_l_di"
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")
--- 9651,9680 ----
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")
  	(ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
  			(const_int -4294967296))
! 		(lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
                               (const_int 32))))]
    "TARGET_SHMEDIA"
    "mshfhi.l	%N2, %N1, %0"
    [(set_attr "type" "arith_media")])
+
+ (define_split
+   [(set (match_operand:DI 0 "arith_reg_dest" "")
+ 	(ior:DI (zero_extend:DI (match_operand:SI 1
+ 					      "extend_reg_or_0_operand" ""))
+ 		(and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "")
+ 			(const_int -4294967296))))
+    (clobber (match_operand:DI 3 "arith_reg_dest" ""))]
+   "TARGET_SHMEDIA"
+   [(const_int 0)]
+   "
+ {
+   emit_insn (gen_ashldi3_media (operands[3],
+ 				simplify_gen_subreg (DImode, operands[1],
+ 						     SImode, 0),
+ 				GEN_INT (32)));
+   emit_insn (gen_mshfhi_l_di (operands[0], operands[3], operands[2]));
+   DONE;
+ }")

  (define_insn "mshflo_l_di"
    [(set (match_operand:DI 0 "arith_reg_dest" "=r")

From-SVN: r55189
2002-07-02 19:45:49 +01:00
Roger Sayle a3acdc0cc1 sh.c (sh_media_init_builtins): Change use of poisoned identifier "bzero" to "memset".
* config/sh/sh.c (sh_media_init_builtins): Change use of poisoned
	identifier "bzero" to "memset".  Pass extra NULL_TREE argument to
	builtin_function.

From-SVN: r55171
2002-07-02 04:01:04 +00:00
J"orn Rennecke c1b92d0906 sh.c (langhooks.h): Include.
* sh.c (langhooks.h): Include.
	(sh_init_builtins, sh_media_init_builtins): New functions.
	(sh_expand_builtin, arith_reg_dest,and_operand): Likewise.
	(mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise.
	(sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise.
	(builtin_description): New struct tag.
	(signature_args, bdesc): New arrays.
	(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define.
	(print_operand): Add 'N' modifier.
	* sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes.
	(EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros.
	(EXTRA_CONSTRAINT): Add 'U' and 'W' cases.
	(CONST_COSTS): Add special case for SHmedia AND.
	(PREDICATE_CODES): Add and_operand, arith_reg_dest,
	extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset,
	sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand.
	target_operand can also be const or unspec.
	* sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants.
	(UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise.
	(attribute type): Add new types.
	(anddi3): Add splitter.
	(movdi_const_16bit+1): Add code to handle vector constants and
	bitmasks efficiently.
	(shori_media): Have generator function made.
	(movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns.
	(movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise.
	(movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise.
	(ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise.
	(negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise.
	(negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise.
	(mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise.
	(mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise.
	(mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise.
	(mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise.
	(mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise.
	(mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise.
	(mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise.
	(mshflo_b,  mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie.
	(mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise.
	(mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise.
	(mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise.
	(lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise.
	(ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise.
	(ftrv): Likewise.

	(fpu_switch+1, fpu_switch+2): Remove constraint.

From-SVN: r55147
2002-07-01 20:41:54 +01:00
J"orn Rennecke e3ba8d11f8 sh-protos.h (sh_pr_interrupt): Declare.
* sh-protos.h (sh_pr_interrupt): Declare.
	* sh.c (sh_pr_interrupt): New function.
	(print_operand, calc_live_regs, sh_expand_prologue): Use it.
	(sh_hard_regno_rename_ok): Likewise.
	* sh.h (NORMAL_MODE): FP_MODE_NONE for interupt handlers.

From-SVN: r54756
2002-06-18 20:03:18 +01:00
Dhananjay R. Deshpande 03b8ec294f sh.h: Define HARD_REGNO_RENAME_OK
Fri Jun 14 12:04:02 2002  Dhananjay R. Deshpande <dhananjayd@kpit.com>

	* sh.h: Define HARD_REGNO_RENAME_OK
	* sh.c: sh_hard_regno_rename_ok: New. If current function has
	interrupt_handler attribute, only registers saved on stack are OK.
	* sh-protos.h: Declare sh_hard_regno_rename_ok.

From-SVN: r54612
2002-06-14 12:06:38 +01:00
J"orn Rennecke 9d7ed8065d sh.c (calc_live_regs): Don't use initial_value optimization for PR_MEDIA_REG.
* config/sh/sh.c (calc_live_regs): Don't use initial_value
	optimization for PR_MEDIA_REG.

From-SVN: r54600
2002-06-13 22:31:58 +01:00
David S. Miller 2f937369fa Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05  David S. Miller  <davem@redhat.com>

	Delete SEQUENCE rtl usage outside of reorg and ssa passes.
	* rtl.h (gen_sequence, emit_insns, emit_insns_before,
	emit_insns_before_scope, emit_insns_after,
	emit_insns_after_scope): Delete declaration.
	* ada/misc.c (insert_code_for): Use emit_insn* instead of
	emit_insns_foo.
	* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
	(alpha_set_memflags): Fix comment.
	(set_frame_related_p): Use get_insns instead of gen_sequence.
	* config/alpha/alpha.md (setjmp receiver splitter): Avoid
	emitting no insns.
	* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
	gen_sequence.
	(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
	* config/fr30/fr30.c (fr30_move_double): Likewise.
	* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
	Likewise.
	* config/ia64/ia64.c (spill_restore_mem): Likewise.
	* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
	no insns.
	* config/m32r/m32r.c (gen_split_move_double): Use get_insns
	instead of gen_sequence.
	* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
	(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
	* config/sh/sh.c (sh_need_epilogue): Likewise.
	* config/sparc/sparc.md (current_function_calls_alloca, flat): New
	attributes.
	(setjmp pattern and split): Use them to avoid splitter which emits
	no RTL.
	* genattrtab.c (main): Emit include of function.h
	* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
	get_insns instead of gen_sequence.
	* config/cris/cris.c (cris_split_movdx): Likewise.
	* emit-rtl.c (emit_insns*): Kill.
	(try_split): Expect insn list instead of SEQUENCE.
	(make_jump_insn_raw, make_call_insn_raw): Fix comments.
	(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
	Make them abort if a SEQUENCE is given and RTL checking is
	enabled.
	(emit_*_scope): Don't forget to set scope on final insn.
	(gen_sequence): Move from here...
	* ssa.c (gen_sequence): To here as private function.
	* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
	comments.
	(expand_builtin_return, expand_builtin_mathfn): Likewise.
	(expand_builtin_strlen): Use get_insns instead of gen_sequence.
	(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
	(expand_builtin_expect_jump): Use get_insns and fix comments.
	* calls.c (try_to_integrate): Use emit_insn_foo.
	(expand_call, emit_library_call_value_1): Likewise.
	* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
	(emit_move_insn_1): Use get_insns instead of gen_sequence.
	(expand_expr): Use emit_insn_foo.
	* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
	* except.c (build_post_landing_pads): Likewise.
	* flow.c (attempt_auto_inc): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
	expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
	* function.c (fixup_var_refs_insn): Use get_insns instead of
	gen_sequence.
	(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
	(fixup_memory_subreg): Use get_insns instead of gen_sequence.
	(fixup_stack_1, purge_addressof_1, expand_main_function,
	get_arg_pointer_save_area): Likewise.
	(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
	expand_function_end): Use emit_insn_foo.
	(record_insns, keep_stack_depressed): Work with insn list instead
	of SEQUENCE, fix comments.
	* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
	noce_try_store_flag_constants, noce_try_store_flag_inc,
	noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
	noce_try_minmax, noce_try_abs): Use emit_insn_foo.
	(noce_process_if_block): Use get_insns instead of gen_sequence.
	* optabs.c (add_equal_note): Work with insn list, fix comments.
	(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
	(expand_unop, expand_complex_abs, expand_unop_insn,
	expand_no_conflict_block): Likewise.
	(gen_move_insn): Use get_insns instead of gen_sequence.
	(gen_cond_trap): Likewise.
	* integrate.c (copy_rtx_and_substitute): Likewise.
	(emit_initial_value_sets): Use emit_insn_foo.
	* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
	(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
	now that RTL generators give insn lists.
	* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
	* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
	instead of gen_sequence.
	(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
	* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
	instead of gen_sequence.
	* loop.c (move_movables, emit_prefetch_instructions,
	gen_add_mult, check_dbra_loop, gen_load_of_final_value):
	Likewise.
	(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
	(product_cheap_p): Likewise, and add commentary about RTL wastage
	here.
	* lcm.c (optimize_mode_switching): Use get_insns instead of
	gen_sequence.
	* profile.c (gen_edge_profiler): Likewise.
	* regmove.c (copy_src_to_dest): Likewise.
	* reg-stack.c (compensate_edge): Likewise and fix comment.
	* gcse.c (process_insert_insn): Likewise.
	(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
	* jump.c (delete_prior_computation): Update comment.
	* genemit.c (gen_expand, gen_split, main): Use get_insns instead
	of gen_sequence, update comments to match.
	* recog.c (peephole2_optimize): Work with insn lists instead of
	SEQUENCE rtl.
	* sched-vis.c (print_pattern): Abort on SEQUENCE.
	* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
	Use get_insns instead of gen_sequence.
	(copy_loop_body): Likewise and don't emit dummy NOTE.
	* genrecog.c: Don't mention SEQUENCE rtl in comments.
	* combine.c (try_combine): Expect insn lists from split generator.
	* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
	hand.

From-SVN: r54497
2002-06-11 05:22:48 -07:00
J"orn Rennecke 2754d3c5ac Fix cfi generation for SH[1-4]:
* sh.c (frame_insn): New function.
	(output_stack_adjust): Add parameter emit_fn.  All callers changed.
	(push): Now returns rtx.  Use frame_insn.
	(sh_expand_prologue): Clear RTX_FRAME_RELATED_P for second push
	of a DF register.
	* sh.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_RETURN_COLUMN): Define.

From-SVN: r54445
2002-06-10 18:15:13 +01:00
J"orn Rennecke eaeb7de8cb sh.c (machine_dependent_reorg): Don't set RTX_UNCHANGING_P on an UNSPEC.
* sh.c (machine_dependent_reorg): Don't set RTX_UNCHANGING_P
	on an UNSPEC.

From-SVN: r54318
2002-06-06 16:14:39 +01:00
Geoffrey Keating e2500fedef Merge from pch-branch up to tag pch-commit-20020603.
From-SVN: r54232
2002-06-04 07:11:05 +00:00
Toshiyasu Morita 62526ec32f * config/sh/sh.c: Include real.h for REAL_VALUE_TYPE.
From-SVN: r53975
2002-05-28 23:43:31 +01:00
J"orn Rennecke f1a58d928b config/sh reorganization to factor out endianness and coff:
* config/sh/little.h: New file.
        * config/sh/sh.h (TARGET_ENDIAN_DEFAULT): If not already
        defined, define to 0 to select big-endian.
	(SUBTARGET_ASM_ENDIAN_SPEC): Define according to TARGET_ENDIAN_DEFAULT.
        (TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT.
        * config/sh/sh64.h (TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT.
        * config/sh/t-be: New file.
        * config/sh/t-le: New file.

	* sh.h (SDB_DEBUGGING_INFO, #include "dbxcoff.h"): Moved to sh/coff.h.
	(SDB_DELIM, MAX_OFILE_ALIGNMENT, IDENT_ASM_OP): Likewise.
	(TARGET_ASM_NAMED_SECTION, ASM_OUTPUT_SKIP): Likewise.
	(USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX): Likewise.
	(ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL): Likewise.
	(ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise.
	(ASM_FILE_END, ASM_DECLARE_FUNCTION_NAME): Deleted.
	(CPP_SPEC, SUBTARGET_CPP_ENDIAN_SPEC): Likewise.
	(SUBTARGET_CPP_SPEC, CPP_DEFAULT_CPU_SPEC, CPP_PREDEFINES): Likewise.
	(EXTRA_SPECS): Remove SUBTARGET_CPP_ENDIAN_SPEC and
	CPP_DEFAULT_CPU_SPEC.  Add LINK_EMUL_PREFIX, LINK_DEFAULT_CPU_EMUL,
	SUBTARGET_LINK_EMUL_SUFFIX and SUBTARGET_LINK_SPEC.
	(LINK_SPEC): Define to SH_LINK_SPEC.
	(TARGET_CPU_CPP_BUILTINS, SH_LINK_SPEC): Define.
	(LINK_EMUL_PREFIX, LINK_DEFAULT_CPU_EMUL): Likewise.
	(SUBTARGET_LINK_EMUL_SUFFIX, SUBTARGET_LINK_SPEC): Likewise.
	(CPP_SPEC): Reduce to %(subtarget_cpp_spec).
	(TARGET_ENDIAN_DEFAULT): Define if not already defined.
	* config/sh/coff.h: New file.
	(TARGET_ASM_NAMED_SECTION): Now default_coff_asm_named_section
	(TARGET_OBJFMT_CPP_BUILTINS): Define.
	* config/sh/elf.h (IDENT_ASM_OP): No need to #undef at the start.
	(ASM_FILE_END, ASM_OUTPUT_SOURCE_LINE): Likewise.
	(DBX_OUTPUT_MAIN_SOURCE_FILE_END, TARGET_ASM_NAMED_SECTION): Likewise.
	(ASM_DECLARE_FUNCTION_NAME, MAX_OFILE_ALIGNMENT, SIZE_TYPE): Likewise.
	(PTRDIFF_TYPE): Likewise.
	("dbxelf.h", "elfos.h", "svr4.h"): Don't #include.
	(CPP_PREDEFINES): Don't define.
	(TARGET_OBJFMT_CPP_BUILTINS): Define.
	(LINK_SPEC): Define to SH_LINK_SPEC.
	(LINK_EMUL_PREFIX): Redefine.
	* config/sh/linux.h: (SUBTARGET_CPP_SPEC): Remove -fpic / -fPIC cases.
	(SUBTARGET_CPP_ENDIAN_SPEC, CPP_DEFAULT_CPU_SPEC): Remove redefinition.
	(CPP_PREDEFINES, SUBTARGET_ASM_ENDIAN_SPEC): Likewise.
	(CC1_SPEC, CC1PLUS_SPEC, LINK_SPEC): Likewise.
	(TARGET_OS_CPP_BUILTINS): Define.
	(TARGET_DEFAULT): Redefine.
	(SUBTARGET_LINK_EMUL_SUFFIX, SUBTARGET_LINK_SPEC): Likewise.
	* config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Remove.
	(LINK_SPEC): Don't redefine.
	(LINK_DEFAULT_CPU_EMUL): Redefine.
	(TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT.
	* sh.c (sh_asm_named_section): Don't declare / define.
	* t-linux (MULTILIB_OPTIONS): Rely on pre-set endianness option.
	* config.gcc (sh-*-elf* tm_file): Add dbxelf.h elfos.h svr4.h.
	(sh64-*-elf* tm_file): Likewise.
	(sh-*-rtemself* tm_file): Likewise.
	(sh-*-linux* tm_file): Likewise.  Add sh/little.h.
	(sh-*-linux* tmake_file): Add sh/t-le.
	(sh-*-rtems* tm_file): Add sh/coff.h
	(sh-*-* tm_file): Likewise.


	* sh.h (LEGITIMATE_PIC_OPERAND_P): Check for SYMBOL_REF before using
	CONSTANT_POOL_ADDRESS_P.

	* coff.h (HAS_INIT_SECTION, INVOKE__MAIN): Define.

Co-Authored-By: Jason R. Thorpe <thorpej@wasabisystems.com>

From-SVN: r53974
2002-05-28 23:26:43 +01:00
Richard Henderson 47754fd548 target-def.h (TARGET_BINDS_LOCAL_P): New.
* target-def.h (TARGET_BINDS_LOCAL_P): New.
	* target.h (struct gcc_target): Move boolean fields to the end.
	Add binds_local_p.
	* varasm.c (default_binds_local_p): New.
	* output.h: Declare it.

	* config/alpha/alpha.c (alpha_encode_section_info): Use the new hook.
	* config/cris/cris.c (cris_encode_section_info): Likewise.
	* config/i386/i386.c (i386_encode_section_info): Likewise.
	* config/ia64/ia64.c (ia64_encode_section_info): Likewise.
	* config/sh/sh.c (sh_encode_section_info): Likewise.

	* doc/tm.texi (TARGET_IN_SMALL_DATA_P): New.
	(TARGET_BINDS_LOCAL_P): New.

From-SVN: r53620
2002-05-19 02:50:27 -07:00
Richard Henderson 772c526579 system.h (STRIP_NAME_ENCODING): Poison it.
* system.h (STRIP_NAME_ENCODING): Poison it.
	* output.h (STRIP_NAME_ENCODING): Remove.
	(default_strip_name_encoding): Declare.
	* target-def.h (TARGET_STRIP_NAME_ENCODING): New.
	* target.h (strip_name_encoding): New.
	* varasm.c (default_strip_name_encoding): New.

	* dwarf2asm.c, varasm.c, config/darwin.c, config/darwin.h,
	config/alpha/alpha.c, config/arm/pe.c, config/avr/avr.c,
	config/cris/cris.c, config/i386/cygwin.h, config/i386/interix.c,
	config/i386/winnt.c, config/m32r/m32r.h, config/mcore/mcore-elf.h,
	config/mcore/mcore-pe.h, config/mcore/mcore.c, config/mcore/mcore.h,
	config/mips/mips.c, config/mn10200/mn10200.h, config/mn10300/mn10300.h,
	config/pa/pa.c, config/pa/pa.h, config/pa/som.h,
	config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h,
	config/v850/v850.h: Use the hook, not the macro.

	* config/darwin-protos.h, config/darwin.c, config/darwin.h,
	config/alpha/alpha.c, config/alpha/alpha.h, config/h8300/h8300.c,
	config/h8300/h8300.h, config/i386/cygwin.h, config/i386/i386-interix.h,
	config/i386/i386-protos.h, config/i386/win32.h, config/i386/winnt.c,
	config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c,
	config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h,
	config/pa/pa.c, config/rs6000/rs6000.c, config/rs6000/sysv4.h,
	config/rs6000/xcoff.h, config/sh/sh.c, config/sh/sh.h,
	config/v850/v850.c, config/v850/v850.h:
	Move STRIP_NAME_ENCODING to out-of-line function and add
	TARGET_STRIP_NAME_ENCODING.

	* config/arm/arm.c, config/arm/arm.h, config/mmix/mmix-protos.h,
	config/mmix/mmix.c, config/mmix/mmix.h: Replace STRIP_NAME_ENCODING
	with TARGET_STRIP_NAME_ENCODING referencing existing function;
	make function static.

	* xcoffout.c: Include target.h
	* Makefile.in (xcoffout.o): Update.

	* config/avr/avr.c (avr_encode_section_info): Correct prototype.
	* config/avr/avr.h (STRIP_NAME_ENCODING): Remove.
	* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Mark
	reloc argument unused.
	* config/sh/sh.c (TARGET_ENCODE_SECTION_INFO): New.

	* doc/tm.texi (TARGET_STRIP_NAME_ENCODING): Update from previous
	STRIP_NAME_ENCODING docs.

From-SVN: r53615
2002-05-19 00:55:48 -07:00
Richard Henderson fb49053ffd system.h (ENCODE_SECTION_INFO): Poison it.
* system.h (ENCODE_SECTION_INFO): Poison it.
	* target-def.h (TARGET_ENCODE_SECTION_INFO): New.
	* target.h (encode_section_info): New.
	* varasm.c (make_decl_rtl, output_constant_def): Use it.
	* hooks.c (hook_tree_int_void): New.
	* hooks.h: Declare it.

	* config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c,
	config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h,
	config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h,
	config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h,
	config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h,
	config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c,
	config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c,
	config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h,
	config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
	config/mcore/mcore-protos.h, config/mcore/mcore.c,
	config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c,
	config/mmix/mmix.h, config/rs6000/rs6000-protos.h,
	config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h,
	config/stormy16/stormy16.c, config/stormy16/stormy16.h:
	Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO
	referencing existing function.  Make function static.

	* config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c,
	config/arc/arc.h, config/arm/arm.c, config/arm/arm.h,
	config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c,
	config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c,
	config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c,
	config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h,
	config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c,
	config/pa/pa.h, config/romp/romp.c, config/romp/romp.h,
	config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c,
	config/s390/s390.h, config/sh/sh.c, config/sh/sh.h,
	config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c,
	config/v850/v850.h, config/vax/vax.c, config/vax/vms.h,
	config/xtensa/xtensa.c, config/xtensa/xtensa.h:
	Move ENCODE_SECTION_INFO to out-of-line function and add
	TARGET_ENCODE_SECTION_INFO.

	* config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro.
	(ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise.

	* config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename
	from SUBTARGET_*
	(switch_to_section): Replace in_rdata case with in_readonly_data.

	* config/h8300/h8300.c (h8300_encode_label): Make static.
	* config/h8300/h8300-protos.h: Update.

	* config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename
	from rs6000_encode_section_info; make static.
	(rs6000_xcoff_encode_section_info): New.

	* config/v850/v850.c (v850_encode_data_area): Make static.
	* config/v850/v850-protos.h: Update.

	* config/vax/vax.c: Include flags.h.
	(vms_select_section): Fix typo.

	* doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous
	ENCODE_SECTION_INFO docs.

From-SVN: r53606
2002-05-18 22:23:27 -07:00
J"orn Rennecke f78ec36a71 sh.c (sh_builtin_saveregs): If starting with an odd fp register...
* sh.c (sh_builtin_saveregs): If starting with an odd fp register,
	make sure that buffer starts on odd word address.
	(sh_va_arg): Skip odd fp registers when reading a double precision
	value.

From-SVN: r53337
2002-05-09 18:41:56 +01:00
Vladimir Makarov fae15c9379 2002-04-29 Vladimir Makarov <vmakarov@redhat.com>
Merging code from dfa-branch:

From-SVN: r52915
2002-04-29 22:34:36 +00:00
J"orn Rennecke 5e039e6b12 sh.c (sh_va_arg): If argument was passed by reference, dereference the pointer.
* sh.c (sh_va_arg): If argument was passed by reference,
	dereference the pointer.

From-SVN: r52734
2002-04-24 23:12:32 +01:00
J"orn Rennecke 12e85a0e1d sh.c (calc_live_regs, [...]): Use of PR_MEDIA_REG / PR_REG depends on TARGET_SHMEDIA, not TARGET_SH5.
* sh.c (calc_live_regs, sh_pr_n_sets): Use of PR_MEDIA_REG / PR_REG
	depends on TARGET_SHMEDIA, not TARGET_SH5.

From-SVN: r52220
2002-04-12 13:14:33 +01:00
J"orn Rennecke 18778292a0 sh.c (broken_move): Constant 0.
* sh.c (broken_move): Constant 0. / 1. load is OK if there is
	no r0 clobber.

From-SVN: r52214
2002-04-12 11:55:32 +01:00
J"orn Rennecke 1951818c2f config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.
* config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.
	(sh64-*-elf*, sh-*-rtemself*): Likewise.
	* config/sh/embed_bb.c: New file.
	* config/sh/embed-elf.h: New file.
	* sh.h (CPP_SPEC): Supply __SIZE_TYPE__ and __PTRDIFF_TYPE__
	if -m[12345]* option is given.  Don't use subtarget_cpp_ptr_spec.
	(CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ .
	(SUBTARGET_CPP_PTR_SPEC): Don't define.
	(EXTRA_SPECS): Remove subtarget_cpp_ptr_spec.
	Add subtarget_asm_endian_spec.
	(ASM_SPEC): Use subtarget_asm_endian_spec.
	(SUBTARGET_ASM_ENDIAN_SPEC): Define.
	(RETURN_ADDR_RTX): Use PR_MEDIA_REG for TARGET_SH5.
	(WCHAR_UNSIGNED): Define.
	(SH_ELF_WCHAR_TYPE, SH_DBX_REGISTER_NUMBER): Define.
	(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
	(ALLOCATE_INITIAL_VALUE): Use PR_MEDIA_REG for TARGET_SH5.
	Fix value.
	* sh.c (calc_live_regs): Use PR_MEDIA_REG for TARGET_SH5.
	(sh_adjust_cost): Likewise.
	sh64.h (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ .
	(SUBTARGET_CPP_PTR_SPEC, WCHAR_TYPE): Don't #undef/ #define.
	(WCHAR_TYPE_SIZE): Likewise.
	(ASM_SPEC): Use subtarget_asm_endian_spec.
	(SH_ELF_WCHAR_TYPE): #undef/ #define.
	(MAX_WCHAR_TYPE_SIZE): Don't #undef.
	* config/sh/elf.h (WCHAR_UNSIGNED): #undef .
	(MAX_WCHAR_TYPE_SIZE): Don't #define .
	(WCHAR_TYPE, WCHAR_TYPE_SIZE): #undef / #define .
	(USER_LABEL_PREFIX): Don't #undef /#define .
	(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
	* config/elf/linux.h (USER_LABEL_PREFIX): Don't #undef /#define .
	(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Likewise.
	(ASM_SPEC): Likewise.
	(SUBTARGET_ASM_ENDIAN_SPEC): #undef / #define .
	(CC1_SPEC): don't supply -m3 for -m4*, -m5*.
	* t-sh: (LIB1ASMFUNCS): Use LIB1ASMFUNCS_CACHE.
	(LIB2FUNCS_EXTRA): Define.
	* t-sh64 (LIB2FUNCS_EXTRA): Define.
	* config/sh/t-linux (LIB1ASMFUNCS): Don't redefine.
	(LIB1ASMFUNCS_CACHE): Define.
	(LIB2FUNCS_EXTRA): Redefine empty.

From-SVN: r52091
2002-04-09 21:07:15 +01:00
Kaveh R. Ghazi 0139adcaa7 c4x.c (c4x_fp_reglist): Const-ify.
* c4x.c (c4x_fp_reglist): Const-ify.
	* cris.c (cris_print_operand): Likewise.
	* i386.c (ix86_va_arg): Likewise.
	* ia64/unwind-ia64.c (unw_decode_table): Likewise.
	* m32r.c (m32r_hard_regno_mode_ok): Likewise.
	* m32r.h (m32r_hard_regno_mode_ok): Likewise.
	* mcore.c (regno_reg_class, mcore_unique_section): Likewise.
	* mcore.h (regno_reg_class): Likewise.
	* mips.c (gen_int_relational): Likewise.
	* ns32k.c (ns32k_reg_class_contents, regclass_map): Likewise.
	* ns32k.h (ns32k_reg_class_contents, regclass_map): Likewise.
	* pdp11.c (pdp11_assemble_integer): Likewise.
	* pj.h (INITIALIZE_TRAMPOLINE): Likewise.
	* s390.c (s390_branch_condition_mnemonic, regclass_map):
	Likewise.
	* s390.h (regclass_map): Likewise.
	* sh.c (shift_amounts): Likewise.
	* sh.md (rot_tab): Likewise.

From-SVN: r50517
2002-03-10 01:39:04 +00:00
J"orn Rennecke 7ab562744f sh.h (current_function_anonymous_args): Remove.
* sh.h (current_function_anonymous_args): Remove.
	(SETUP_INCOMING_VARARGS): Don't set it - just check that one
	of current_function_varargs and current_function_stdarg is set.
	* sh.c (sh_expand_prologue): Check current_function_varargs /
	current_function_stdarg / TARGET_SH5 instead of
	current_function_anonymous_args.

	* sh64.h (TARGET_VERSION): Define.

Fix comments that to refer to SH architecture -
the architecture is no longer exclusive to Hitachi.

From-SVN: r49931
2002-02-21 16:42:28 +00:00
Alexandre Oliva 2b1fd83f62 sh.c (expand_prologue): Fix mis-applied 2001-11-09's patch.
* config/sh/sh.c (expand_prologue): Fix mis-applied 2001-11-09's
patch.

From-SVN: r49631
2002-02-09 03:51:25 +00:00
Alexandre Oliva fa5322fa58 Contribute sh64-elf.
2002-02-09  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to...
(sh_cannot_modify_jumps_p): New function.
2002-02-05  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to...
(sh_ms_bitfield_layout_p): New function.
2002-02-04  Alexandre Oliva  <aoliva@redhat.com>
	    Zack Weinberg  <zack@codesourcery.com>
* config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use
expand_simple_binop instead of expand_binop.
2002-02-03  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable
use of .quad and .uaquad.
* config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP,
TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above.
2002-01-24  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (movdi_const, movdi_const_32bit,
movdi_const_16bit): Make sure all CONSTs have modes.
(sym2PIC): Ditto, but by adjusting all callers.
* config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live
if the prologue calls the SHmedia argument decoder or register
saver.
2002-01-24  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define.
(TARGET_ASM_ALIGNED_DI_OP): Likewise.
(sh_expand_epilogue): Don't emit USE of return target register.
(prepare_move_operands): Legitimize DImode PIC addresses.
(sh_media_register_for_return): Skip tr0, used to initialize the
PIC register.
(sh_expand_prologue): Remove explicit USE of return register.
(nonpic_symbol_mentioned_p): PC is non-PIC.  Don't recurse in
CONST_DOUBLEs.  UNSPEC_GOTPLT is PIC.
* config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete.
(OVERRIDE_OPTIONS): Don't disable PIC on SH5.
(EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of
EXTRA_CONSTRAINT_T.
(GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New.
(MOVI_SHORI_BASE_OPERAND_P): New.
(NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New.
(EXTRA_CONSTRAINT_T): Define in terms of them.
(OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT.
* config/sh/sh.md (movsi_media, movsi_media_nofpu,
movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to
alternatives supporting TARGET_REGS.
(UNSPEC_GOTPLT): New constant.
(movdi split): Move incrementing of LABEL_NUSES...
(movdi_const, movdi_const_32bit): Here.  Use
MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T.
(movdi_const_16bit): New.
(call, call_value) [flag_pic]: Use GOTPLT.
(call_pop, call_value_pop): New expands.
(call_pop_compact, call_pop_rettramp): New insns.
(call_value_pop_compact, call_value_pop_rettramp): New insns.
(sibcall) [flag_pic]: Use GOT.
(builtint_setjmp_receiver): Remove bogus, unused expand.
(GOTaddr2picreg): Implement for SHcompact and SHmedia.
(*pt, *ptb, ptrel): New insns.
(sym2GOT): Handle DImode GOT.
(sym2GOTPLT, symGOTPLT2reg): New expands.
(sym2PIC): New expand.
(shcompact_return_tramp): Use GOTPLT to return trampoline.
(shcompact_return_tramp_i): Use return register explicitly.
* config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't
disable flag_reorder_blocks.
2002-01-19  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (sibcall_compact): Reorder return, uses and
clobbers, for clarity.
(sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and
restoring of r0 in macl as MAYBE_DEAD.
2002-01-18  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define.
* config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of
alter_subreg all over.
(jump) [TARGET_SHMEDIA]: FAIL to create new jumps after
reload, instead of emitting instructions that would require
reloading.
(casesi_load_media): Add missing modes.
2001-11-09  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (sh_expand_prologue): Mark the PIC register
as used if the argument decoder is called.
2001-08-28  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in
Pmode, then extend it to DImode if necessary.
2001-08-28  Stephen Clarke  <Stephen.Clarke@st.com>
* config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode
constants in FPU-enabled SHmedia, let them be loaded from memory.
2001-08-28  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media):
Adjust whitespace in assembly output templates.
2001-08-28  Stephen Clarke  <Stephen.Clarke@st.com>
* config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust
mode of if_then_else.
2001-08-04  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in
sh.h.
2001-07-26  Andrew Haley  <aph@cambridge.redhat.com>
	    Joern Rennecke <amylaar@redhat.com>
* config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New.
(SUBTARGET_CPP_PTR_SPEC): New.
(SUBTARGET_CPP_SPEC): Remove.
2001-07-06  Chandrakala Chavva  <cchavva@redhat.com>
* config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1):
Fix typo in previous checkin.
2001-07-11  Chandrakala Chavva  <cchavva@redhat.com>
* config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations.
2001-07-10  Chandrakala Chavva  <cchavva@cygnus.com>
	    Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than
what single FP register can hold for SHmedia target.
2001-07-06  Chandrakala Chavva  <cchavva@redhat.com>
	    Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1):
Do not split into SUBREG.
2001-06-14  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures
and added new functions as specified in SH5 ABI r9.
2001-06-04  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an
8-byte boundary.
2001-06-03  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (dump_table): Add const0_rtx in calls of
gen_consttable_4 and gen_consttable_8.  Emit multiple labels
and consttable_window_ends.
2001-06-03  Graham Stott  <grahams@redhat,com>
* config/sh/sh.md (movdi split): Remove unused variable last_insn.
2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (print_operand): Handle floating-point pair,
vector and matrix registers.
* config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer
vector modes into account.
* config/sh/sh.md (movv2sf): Split move between registers into
movdf.
(movv4sf, movv16sf): Introduce insns that get split only after
reload.
* config/sh/shmedia.h: Fix Copyright dates.
* config/sh/ushmedia.h: Likewise.  Move loop counter
declarations into conditionals that uses them.
(sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in
loop boundary.
* config/sh/sshmedia.h: Fix Copyright dates.
(sh_media_PUTCFG): Fix constraints.
2001-05-12  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to
ptrmemfunc_vbit_in_delta for SH5.
2001-05-08  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (TARGET_SWITCHES): Document -m5-*.
* invoke.texi: Likewise.
2001-04-14  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/lib1funcs.asm (GCC_push_shmedia_regs,
GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs,
GCC_pop_shmedia_regs_nofpu): New global symbols.
* config/sh/t-sh64 (LIB1ASMFUNCS): Add them.
* config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro.
* config/sh/sh.c (calc_live_regs): Account for PR's saving in
compact function with nonlocal labels.
(sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed.
(sh_expand_epilogue) [SHcompact]: Pop them when appropriate.
(initial_elimination_offset): Account for their stack space.
* config/sh/sh.md (shmedia_save_restore_regs_compact): New insn.
* config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media,
movhi_media, movdi_media, movdi_media_nofpu, movdf_media,
movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at
least one of the operands to be a register.
(movv2sf): Likewise.  Renamed to movv2sf_i.
(movdi, movdf, movv2sf, movv4sf, movv16sf, movsf):
prepare_move_operands() before emitting SHmedia insns.
2001-04-03  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]:
Don't save nor initialize r12.  Don't mis-align the stack.
Pad the code with a nop.
* config/sh/crti.asm: Don't restore r12.  Don't mis-align the
stack.
2001-03-13  Alexandre Oliva  <aoliva@redhat.com>
* gcc/longlong.h (__umulsidi3, count_leading_zeros)
[__SHMEDIA__]: Implement.
2001-03-11  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md: Set latency of `pt' closer to reality.
(movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu,
movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu):
Set move, load and store type attributes.
* config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3.
* config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable
profiling.
* config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode.
* config/sh/sh-protos.h (sh_media_register_for_return): Declare.
* config/sh/sh.c (sh_media_register_for_return): New function.
(sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available
branch-target register.
(sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it.
* config/sh/sh.md (return_media_i): Use any call-clobbered
branch-target register.
(return_media): If r18 wasn't copied in the prologue, copy it
here.
* config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]:
Clear class FP0_REGS.
* config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied
from elf.h.
2001-03-08  DJ Delorie  <dj@redhat.com>
* config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA.
2001-02-09  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (sibcall_compact): Set fp_mode to single.
2001-02-07  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'.
2001-02-03  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode
return value correctly for call_cookie.
2001-02-01  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/crt1.asm (start): Modified so as to call
___setup_argv_and_call_main.
2001-01-26  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in
SHmedia mode.
2001-01-20  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro.
(STRIP_NAME_ENCODING): Use it.
(ASM_OUTPUT_LABELREF): Likewise.  Don't call assemble_name().
2001-01-19  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of
prepare_scc_operands().
* config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"...
(DATALABEL_SYMNAME_P): ... so that we don't need memcmp here.
2001-01-17  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'.
2001-01-13  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (shcompact_incoming_args): Use R0_REG.
* config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants,
used in shcompact_incoming_args.
* config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous
change.
* config/sh/crt1.asm (start) [SH5]: Switch to single-precision
mode.
* config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr):
Adjust accordingly.
* config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue):
Simplify.  Adjust.  Add sanity check.
* config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set
FPU_SINGLE_BIT.
* config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match
TARGET_SHCOMPACT.
(udivsi3, divsi3): Use them.
(force_mode_for_call): New insn.
(call, call_value, sibcall_value): Emit it before SHcompact
calls.
2001-01-11  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (call, call_value, sibcall): Make sure the
call cookie is non-NULL before taking its value.
2001-01-10  Alexandre Oliva  <aoliva@redhat.com>
* config.gcc (sh64): Set target_requires_64bit_host_wide_int.
2001-01-09  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (shcompact_incoming_args): Set argument memory
block.
* config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1.
* config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as
temporary for stack adjusts.  Use MACL and MACH to pass
arguments to shcompact_incoming_args.
* config/sh/sh.md (shcompact_incoming_args): Adjust.  Don't
clobber r1.
* config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise.
(nested_trampoline): Load static chain address into r1.
* config/sh/sh.md (movdi_media splits): Fix sign-extension.
2001-01-07  Alexandre Oliva  <aoliva@redhat.com
* config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call
fp_arith_reg_operand().
2001-01-06  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (casesi): Sign-extend the first two operands,
and use signed compares for them.
* config/sh/sh.c (dump_table): Don't emit 8-byte constants after
4-byte ones.  Instead, inter-leave them, maintaining the 8-byte
ones properly aligned.
(find_barrier): Account for extra alignment needed for 8-byte wide
constants.
(machine_dependent_reorg): Require a label for the second 4-byte
constant after an 8-byte one.
* config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's
change.
2001-01-05  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset
last_float when switching float modes.
* config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer
auto-increment for general-purpose registers.
* config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the
result.
* config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary
for stack adjust.
* config/sh/sh.c (sh_builtin_saveregs): Support using all
registers for varargs.
2001-01-01  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify.
* config/sh/sh.h (CALL_COOKIE_STACKSEQ,
CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros.
(CALL_COOKIE_INT_REG_SHIFT): Adjust.
(FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK.  Adjust
call_cookie accordingly.
(FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK.
(SHCOMPACT_BYREF): Likewise.
(SHCOMPACT_FORCE_ON_STACK): New macro.
* config/sh/sh.c (sh_expand_prologue): Use new call_cookie format.
(sh_builtin_saveregs): Likewise.
* config/sh/lib1funcs.asm (shcompact_call_trampoline,
shcompact_incoming_args): Use new shift values.  Support
sequences of consecutive and non-consecutive pushes/pops.
* config/sh/sh.md (return): Don't explicitly use PR_REG.
2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
* config/sh/sh.h (TEXT_SECTION): Define.
* config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP.
2001-01-05  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro.
* config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for
return values on FPU-enabled SHmedia.
(FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on
FPU-enabled SHmedia.
(INIT_CUMULATIVE_ARGS): Set up return trampoline only if
value is returned in a non-FP reg and is not returned by
reference.
* config/sh/sh.md (shcompact_return_tramp_i): Change type to
jump_ind.
2000-01-04  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New.
(FUNCTION_ARG_CALLEE_COPIES): Require argument to be
quad-aligned to be passed by callee-copy reference.
2001-01-03  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define.
* config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine.
2001-01-02  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in
copying low-numbered FP regs to r7 and r8.
* config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of
FP regs to general-purpose regs only if the copy was passed on the
stack.
* config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in
copying FP reg to r9.
* config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to
copy FP regs to general-purpose regs only in outgoing calls.
* config/sh/sh.md (movdf_media, movsf_media): Revert incorrect
change from 	2000-10-30.  Adjust for 64-bit (or 32-bit)
HOST_WIDE_INT.
* config/sh/sh.h (struct sh_args): Document all fields.
(FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments
passed partially on the stack should not consider making
sibcalls.
* config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to
stack_regs only for incoming calls.  When passing FP args,
make sure there are FP regs available before modifying
call_cookie.
(SHCOMPACT_BYREF): Pass double args in general-purpose
registers by reference.
2000-12-30  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't
attempt to generate sibcalls if the caller got any arguments
by reference.
* config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double.
* config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode
to 8-byte boundaries.
* config/sh/sh.md (shcompact_preserve_incoming_args): New insn.
* config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro.
* config/sh/sh.c (sh_expand_prologue): Preserve args that will be
stored in the stack.
* config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange
for the offsets to have the ISA bit set.
(shcompact_call_trampoline): Document.  Swap r0 and r1, to match
invocation.  Use beq instead of bgt to mark end of sequence of
loads.
(shcompact_incoming_args): Fix store of r2.  Use beq instead of
bgt to mark end of sequence of stores.
* config/sh/sh.c (arith_operand): Don't check whether
CONST_OK_FOR_J for now.
* config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT
instead of long for conversion.
2000-12-29  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.c (print_operand_address): Convert INTVAL to int
before passing it to fprintf.
2000-12-28  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit.
Call set_fpscr before reading/writing SR.
* config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR.
Call set_fpscr.
* config/sh/lib1funcs.asm: Add `.align 2' directives before
SHmedia code.
(FMOVD_WORKS): Define on SH5 with FPU.
(set_fpscr): Define on SH5.  Remove separate _fpscr_values
setting.
* config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of
_fpscr_values.
2000-12-28  Hans-Peter Nilsson  <hpn@cygnus.com>
* config/sh/lib1funcs.asm (ct_main_table): Align contents to even
address.
(ia_main_table): Ditto.
2000-12-27  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define.
* config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate
the definitions from sh.h.
* config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on
TARGET_SH5.
(SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined.
* config/sh/elf.h (PTRDIFF_TYPE): Likewise.
* config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise.
2000-12-26  Alexandre Oliva  <aoliva@redhat.com>
* config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes.
Increment LABEL_NUSES.

From-SVN: r49630
2002-02-09 03:08:08 +00:00
Kazu Hirata e03f5d43cb avr.c: Fix comment typos.
* config/avr/avr.c: Fix comment typos.
	* config/c4x/c4x.md: Likewise.
	* config/dsp16xx/dsp16xx.h: Likewise.
	* config/dsp16xx/dsp16xx.md: Likewise.
	* config/i386/i386.md: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/m32r/m32r.h: Likewise.
	* config/m68hc11/m68hc11.md: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mn10200/mn10200.c: Likewise.
	* config/romp/romp.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/stormy16/stormy16.h: Likewise.
	* config/stormy16/stormy16.md: Likewise.

From-SVN: r48496
2002-01-03 05:04:34 +00:00