Commit Graph

126 Commits

Author SHA1 Message Date
Clinton Popetz 8ceaac3c6e sh.c (gen_far_branch, [...]): Update to reflect new prototypes for redirect_jump and invert_jump.
* config/sh/sh.c (gen_far_branch, split_branches): Update
	to reflect new prototypes for redirect_jump and invert_jump.
	(sh_insn_length_adjustment): Get rid of const warnings.

From-SVN: r34113
2000-05-23 16:10:17 -04:00
J"orn Rennecke 9342c0c4a9 sh.c (sh_insn_length_adjustment): New function.
* sh.c (sh_insn_length_adjustment): New function.
	* sh-protos.h (sh_insn_length_adjustment): Declare.
	* sh.h (ADJUST_INSN_LENGTH): Use it.

From-SVN: r32942
2000-04-06 00:12:53 +01:00
Clinton Popetz b1b41fe4ac sh.c: (barrier_align): Handle a delay slot that is filled with an insn from the jump...
* config/sh/sh.c: (barrier_align): Handle a delay slot that is
	filled with an insn from the jump target.

From-SVN: r32371
2000-03-06 16:17:44 -05:00
Joern Rennecke 475f26dde6 Comment typo fix.
From-SVN: r32242
2000-02-28 21:42:55 +00:00
Jeff Law 4592bdcbb8 Fix copyrights.
From-SVN: r32198
2000-02-26 14:44:42 -07:00
J"orn Rennecke 0ad913af75 sh.c (calc_live_regs): Multiply value assigned to *COUNT_PTR by UNITS_PER_WORD.
* sh.c (calc_live_regs): Multiply value assigned to *COUNT_PTR by
	UNITS_PER_WORD.  Change caller initial_elimination_offset.
	(rounded_frame_size): Take into account that argument pushed has
	changed.  Fix TARGET_ALIGN_DOUBLE problem.

From-SVN: r32152
2000-02-25 20:12:02 +00:00
J"orn Rennecke e5f8d4c0c7 Fix bug exposed by reload.c no longer rounding the frame size to BIGGEST_ALIGNMENT:
Fix bug exposed by reload.c no longer rounding the frame
	size to BIGGEST_ALIGNMENT:
	* sh.c (rounded_frame_size): New function.
	(sh_expand_prologue, sh_expand_epilogue): Use it.
	(initial_elimination_offset): Likewise.

From-SVN: r32138
2000-02-24 22:14:14 +00:00
J"orn Rennecke afbc290536 Fix breakage from 6th Feb thread_prologue_and_epilogue_insns change:
* sh-protos.h (sh_need_epilogue): Declare.
	* sh.c (sh_need_epilogue_known): New static variable.
	(sh_need_epilogue): New function.
	(function_epilogue): Clear need_epilogue_known.
	* sh.md (return): Split into expander / insn pattern.
	Make the expander conditional on ! sh_need_epilogue ().

From-SVN: r32136
2000-02-24 20:09:30 +00:00
J"orn Rennecke 2148624a44 final.c (shorten_branches): Make value passed to LABEL_ALIGN conform to documentation.
* final.c (shorten_branches): Make value passed to LABEL_ALIGN
	conform to documentation.
	* sh.h (LABEL_ALIGN): If aligning loops, call sh_label_align
	to check for special cases.
	* sh-protos.h (sh_label_align): Declare.
	* sh.c (sh_label_align): Define.

From-SVN: r32114
2000-02-23 17:18:15 +00:00
J"orn Rennecke c284306145 sh.h (OVERRIDE_OPTIONS): Don't set sh_addr_diff_vec_mode.
* sh.h (OVERRIDE_OPTIONS): Don't set sh_addr_diff_vec_mode.
	(sh_addr_diff_vec_mode): Don't declare.
	* sh.c (sh_addr_diff_vec_mode): Delete.

From-SVN: r32000
2000-02-16 03:23:40 +00:00
J"orn Rennecke 9f09b1f272 Makefile.in (lcm.o): Depend on insn-attr.h.
* Makefile.in (lcm.o): Depend on insn-attr.h.
	* basic-block.h (optimize_mode_switching): Declare.
	* lcm.c (tm_p.h, insn-attr.h): #include.
	(seginfo, bb_info): New structs.
	(antic, transp, comp, delete, insert) : New file-scope static variables.
	(new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions.
	(reg_becomes_live, optimize_mode_switching): Likewise.
	* tm.texi: Add description of mode switching macros.
	* toplev.c (rest_of_compilation): Call optimize_mode_switching.

	* sh-protos.h (remove_dead_before_cse): Remove prototype.
	(fldi_ok, fpscr_set_from_mem): New prototypes.
	* sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set.
	(CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS):
	Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD).
	(sh_flag_remove_dead_before_cse): Remove declaration.
	(NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros.
	(MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise.
	(MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise.
	* sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD).
	(barrier_align): Allow for JUMP_INSNS containing a parallel.
	(machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set.
	(fldi_ok): New function.
	(get_fpscr_rtx): Add fpscr_rtx as GC root.
	(emit_sf_insn): Only generate fpu switches when optimize < 1.
	(emit_df_insn): Likewise.
	(expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete.
	(sh_flag_remove_dead_before_cse): Delete.
	(get_free_reg, fpscr_set_from_mem): New functions.
	* sh.md (movdf, movsf): Remove no_new_pseudos code.
	(return): Remove emit_fpscr_use / remove_dead_before_cse calls.

Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com>

From-SVN: r31990
2000-02-15 22:34:33 +00:00
Kaveh R. Ghazi 9f8f4efee3 Makefile.in (TREE_H, [...]): Depend on version.h.
* Makefile.in (TREE_H, collect2.o, gcc.h, mips-tfile.o, cccp.o,
	cpphash.o, cppinit.o, protoize.o, unprotoize.o): Depend on version.h.

	* cccp.c: Include version.h and/or don't declare `version_string'.
	* collect2.c: Likewise.
	* alpha.c: Likewise.
	* arm/aof.h: Likewise.
	* arm/coff.h: Likewise.
	* arm/elf.h: Likewise.
	* arm/pe.h: Likewise.
	* arm/tcoff.h: Likewise.
	* arm/telf.h: Likewise.
	* arm/tpe.h: Likewise.
	* arm/vxarm.h: Likewise.
	* convex/convex.c: Likewise.
	* i386/dgux.c: Likewise.
	* i386/sun386.h: Likewise.
	* m88k/m88k.c: Likewise.
	* mcore/mcore-pe.h: Likewise.
	* mips/mips.h: Likewise.
	* romp/romp.h: Likewise.
	* sh/sh.c: Likewise.
	* cpphash.c: Likewise.
	* cppinit.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* gcc.c: Likewise.
	* gcc.h: Likewise.
	* mips-tfile.c: Likewise.
	* protoize.c: Likewise.
	* toplev.c: Likewise.
	* tree.h: Likewise.

	* version.c (version_string): Constify a char*.

	* version.h: New file.

ch:
	* grant.c: Don't declare `version_string'.

f:
	* g77spec.c: Don't declare `version_string'.

java:
	* Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
	version.o.
	(jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.

	* gjavah.c: Include version.h.

	* jcf-dump.c: Likewise.

	* jv-scan.c: Likewise.

From-SVN: r31984
2000-02-15 16:36:35 +00:00
J"orn Rennecke 10db12e0c6 Back out prepare_scc_operands changes from this afternoon.
From-SVN: r31515
2000-01-19 21:57:38 +00:00
J"orn Rennecke 21d17d9c84 * sh.c (prepare_scc_operands): Add EQ case.
From-SVN: r31514
2000-01-19 21:49:21 +00:00
J"orn Rennecke eda44c7832 sh.c (prepare_scc_operands): Abort if no compare insn is available.
* sh.c (prepare_scc_operands): Abort if no compare insn is available.
	(find_barrier, gen_block_redirect, split_branches): Fix indentation.
	(calc_live_regs): Likewise.

From-SVN: r31507
2000-01-19 20:00:09 +00:00
Kaveh R. Ghazi 318881c06e sh-protos.h: New file.
* sh-protos.h: New file.

	* sh.c: Include insn-config.h, toplev.h, recog.h and tm_p.h.
	Add static prototypes.  Fix compile time warnings.

	* sh.h: Move prototypes to sh-protos.h.  Fix compile time warnings.
	* sh.md: Likewise.
	* elf.h: Likewise.

From-SVN: r31418
2000-01-14 16:28:59 +00:00
Richard Henderson 514066a133 sh.c (sh_builtin_saveregs): Use get_varargs_alias_set.
* sh.c (sh_builtin_saveregs): Use get_varargs_alias_set.
        (sh_build_va_list, sh_va_start, sh_va_arg): New.
        * sh.h (BUILD_VA_LIST_TYPE): New.
        (EXPAND_BUILTIN_VA_START, EXPAND_BUILTIN_VA_ARG): New.

From-SVN: r29415
1999-09-14 16:29:48 -07:00
Jeff Law c5c7673583 Merge in gcc2-ss-010999
From-SVN: r29150
1999-09-06 23:49:18 -06:00
Kaveh R. Ghazi 6f7d635c0e rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.

	* rtl.c (rtx_format): Likewise.
	(copy_rtx, copy_most_rtx, read_rtx): Likewise.
	(init_rtl): Use accessor macro, not `rtx_format'.

	* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
	char*.

	* caller-save.c (mark_referenced_regs): Likewise.

	* combine.c (subst, make_compound_operation, known_cond,
	gen_rtx_combine, update_table_tick, get_last_value_validate,
	use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.

	* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
	refers_to_p, canon_reg, fold_rtx, cse_process_notes,
	count_reg_usage): Likewise.

	* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
	Likewise.

	* final.c (leaf_renumber_regs_insn): Likewise.

	* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
	dump_edge_info, count_reg_references): Likewise.

	* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
	fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
	Likewise.

	* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
	oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
	add_label_notes): Likewise.

	* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
	clear_struct_flag, count_sub_rtxs, count_alternatives,
	compares_alternatives_p, contained_in_p, walk_attr_value,
	write_expr_attr_cache): Likewise.

	* genconfig.c (walk_insn_part): Likewise.

	* genemit.c (max_operand_1, gen_exp): Likewise.

	* genextract.c (walk_rtx): Likewise.

	* genflags.c (num_operands): Likewise.

	* genoutput.c (scan_operands): Likewise.

	* genpeep.c (match_rtx): Likewise.

	* genrecog.c (add_to_sequence): Likewise.

	* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
	Likewise.

	* integrate.c (save_constants, copy_for_inline,
	copy_rtx_and_substitute, subst_constants, restore_constants):
	Likewise.

	* jump.c  (mark_jump_label, invert_exp, redirect_exp,
	rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.

	* local-alloc.c (contains_replace_regs, memref_referenced_p):
	Likewise.

	* loop.c (record_excess_regs, rtx_equal_for_loop_p,
	add_label_notes, replace_call_address, count_nonfixed_reads,
	invariant_p, find_single_use_in_loop, find_mem_givs,
	find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
	Likewise.

	* print-rtl.c (reg_names, print_rtx): Likewise.

	* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.

	* reg-stack.c (stack_regs_mentioned_p, record_label_references,
	record_reg_life_pat, swap_rtx_condition, goto_block_pat,
	print_blocks): Likewise.

	* regclass.c (fix_register, record_address_regs,
	reg_scan_mark_refs): Likewise.

	* regmove.c (stable_but_for_p): Likewise.

	* reload.c (loc_mentioned_in_p, operands_match_p,
	find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
	copy_replacements, refers_to_regno_for_reload_p,
	refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
	reload_when_needed_name, reg_class_names, debug_reload_to_stream):
	Likewise.

	* reload1.c (eliminate_regs, scan_paradoxical_subregs,
	delete_address_reloads_1, count_occurrences,
	reload_cse_mem_conflict_p, reload_combine_note_use,
	add_auto_inc_notes): Likewise.

	* resource.c (mark_referenced_resources, mark_set_resources):
	Likewise.

	* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
	reg_mentioned_p, regs_set_between_p, modified_between_p,
	modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
	rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
	may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
	jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.

	* sched.c (sched_analyze_2, attach_deaths): Likewise.

	* stupid.c (stupid_mark_refs): Likewise.

	* unroll.c (remap_split_bivs): Likewise.

	* varasm.c (mark_constants): Likewise.

	* a29k/a29k.c (uses_local_reg_p): Likewise.

	* alpha/alpha.c (summarize_insn): Likewise.

	* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
	eliminate_lr2ip): Likewise.

	* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.

	* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
	reg_mentioned_in_mem): Likewise.

	* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
	symbolic_reference_mentioned_p): Likewise.

	* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.

	* sh/sh.c (regs_used, mark_use): Likewise.

	* vax/vax.c (vax_rtx_cost): Likewise.

From-SVN: r28784
1999-08-20 23:05:25 +00:00
Jim Wilson ab1672a333 Fix -O0 core dump reported by Fred Fish.
* config/sh/sh.c (machine_dependent_reorg): Only call PUT_MODE on
	note if it is non-NULL.

From-SVN: r28653
1999-08-10 17:26:38 -07:00
Bernd Schmidt 49ad7cfa7a Include function.h in most files.
Include function.h in most files.  Remove most of the global variables
duplicated in function.h.  Add accessor macros for them which access
current_function.  Delete INLINE_HEADER rtx and related code, replace
with code using struct function to store inlining related data.

From-SVN: r28626
1999-08-09 14:00:21 +00:00
Richard Henderson 648d2ffce8 m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
* m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
        * m88k.h, m88k.c: Likewise.
        * mn10300.h, mn10300.c: Likewise.
        * pa.h, pa.c: Likewise.
        * rs6000.h, rs6000.c: Likewise.
        * sh.h, sh.c: Likewise.
        * sparc.h, sparc.c: Likewise.

From-SVN: r28245
1999-07-25 18:21:59 -07:00
J"orn Rennecke b8794099b7 sh.c (machine_dependent_reorg): When fixing up fp pcloads...
* sh.c (machine_dependent_reorg): When fixing up fp pcloads,
	remove the clobber of r0 and change the REG_UNUSED note to
	REG_INC.

From-SVN: r27676
1999-06-21 20:21:48 +01:00
J"orn Rennecke 4d070fd3cd Fix pcrel too far problems due to upping CACHE_LOG on SH2:
* sh.c (barrier_align): Don't return early for normal branch/barrier
        when optimizing for SH2.

From-SVN: r27333
1999-06-03 22:48:04 +01:00
J"orn Rennecke eb3881bf7d sh.c (fixup_addr_diff_vecs): Emit braf reference label.
* sh.c (fixup_addr_diff_vecs): Emit braf reference label.
	(braf_label_ref_operand): Delete.
	* sh.h (PREDICATE_CODES): Remove braf_label_ref_operand.
	* sh.md (casesi_jump_2): Operand1 is now the inside of a
	label_ref, and has no predicate.
	The patten has a predicate to guard against invalid substitutions.
	(dummy_jump): Delete.
	(casesi): Update use of casesi_jump_2.

From-SVN: r27329
1999-06-03 21:00:16 +01:00
J"orn Rennecke 66c0b347bc sh.c (fp_arith_reg_operand): Actually test if reg is suitable for FP arithmetic.
* sh.c (fp_arith_reg_operand): Actually test if reg is suitable
	for FP arithmetic.  Changed caller.
	* sh.md (subsf3, subsf_i): Use fp_arith_reg_operand.

From-SVN: r25670
1999-03-10 11:07:32 +00:00
J"orn Rennecke 0aa692fc03 sh.c (force_into): New function.
* sh.c (force_into): New function.
	(expand_block_move): Use it.

From-SVN: r25540
1999-03-02 16:42:59 +00:00
J"orn Rennecke 9ab70a9bd7 sh.h (PASS_IN_REG_P): For TARGET_HITACHI, don't pass structures in registers.
* sh.h (PASS_IN_REG_P):  For TARGET_HITACHI, don't pass structures
	in registers.
	* expr.h (PRETEND_OUTGOING_VARARGS_NAMED): Provide default definition.
	* function.c (assign_parms): Honour PRETEND_OUTGOING_VARARGS_NAMED.
	* calls.c (expand_call): Likewise.
	* sh.c (sh_expand_prologue): For TARGET_HITACHI, don't push varargs /
	stdarg arguments.
	* sh.h (CPP_SPEC): Add -D__HITACHI__ for -mhitachi.
	(FUNCTION_ARG):  For TARGET_HITACHI, don't pass unnamed
	arguments in registers.
	(PRETEND_OUTGOING_VARARGS_NAMED): Define.
	* va-sh.h (entire file): If __HITACHI__ is defined, use sh[123]
	flavour varargs.

From-SVN: r25440
1999-02-25 14:02:32 +00:00
Mark Mitchell c6df88cbec rtl.h (rtx_def): Update documentation.
* rtl.h (rtx_def): Update documentation.
	(MEM_IN_STRUCT_P): Likewise.
	(MEM_SCALAR_P): New macro.
	(MEM_COPY_ATTRIBUTES): Likewise.
	(MEM_SET_IN_STRUCT_P): Likewise.
	* rtl.texi (MEM_SCALAR_P): Document.
	* alias.c (canon_rtx): Use MEM_COPY_ATTRIBUTES.
	(fixed_scalar_and_varying_struct_p): New function.  Use
	MEM_SCALAR_P rather than !MEM_IN_STRUCT_P.
	(aliases_everything_p): Likewise.
	(true_dependence): Use them.
	(write_dependence_p): New function, containing code common to
	anti_dependence and output_dependence.
	(anti_dependence): Use it.
	(output_dependence): Likewise.
	* calls.c (save_fixed_argument_area): Don't clear
	MEM_IN_STRUCT_P.
	(expand_call): Use MEM_SET_IN_STRUCT_P.
	(emit_library_call): Don't clear MEM_IN_STRUCT_P.
	(emit_library_call_value): Likewise.
	(store_one_arg): Use MEM_SET_IN_STRUCT_P.
	* combine.c (simplify_rtx): Use MEM_COPY_ATTRIBUTES.
	(make_extraction): Likewise.
	(simplify_shift_const): Likewise.
	(gen_lowpart_for_combine): Likewise.
	* cse.c (gen_lowpart_if_possible): Use MEM_COPY_ATTRIBUTES.
	* emit-rtl.c (operand_subword): Likewise.
	(change_address): Likewise.
	* explow.c (stabilize): Use MEM_COPY_ATTRIBUTES.
	* expr.c (protect_from_queue): Use MEM_COPY_ATTRIBUTES.
	(emit_group_store): Use MEM_SET_IN_STRUCT_P.
	(copy_blkmode_from_reg): Likewise.
	(store_field): Likewise.
	(expand_expr): Remove bogus guesswork setting MEM_IN_STRUCT_P
	heuristically.  Use MEM_SET_IN_STRUCT_P.
	(get_memory_rtx): Likewise.
	* final.c (alter_subreg): Use MEM_COPY_ATTRIBUTES.
	* function.c (assign_stack_temp): Clear MEM_SCALAR_P and
	MEM_ALIAS_SET on newly returned MEMs.
	(assign_temp): Use MEM_SET_IN_STRUCT_P.
	(put_reg_into_stack): Likewise.
	(fixup_var_refs1): Use MEM_COPY_ATTRIBUTES.
	(gen_mem_addressof): Use MEM_SET_IN_STRUCT_P.
	(assign_parms): Likewise.
	(expand_function): Likewise.
	* integrate.c (expand_inline_function): Likewise.
	(copy_rtx_and_substitute): Use MEM_COPY_ATTRIBUTES.
	* loop.c (note_addr_stored): Remove check on MEM_IN_STRUCT_P.
	* optabs.c (gen_move_insn): Use MEM_COPY_ATTRIBUTES.
	* print-rtl.c (print_rtx): Print /f for frame_related.
	* recog.c (validate_replace_rtx_1): Use MEM_COPY_ATTRIBUTES.
	* reload1.c (reload): Copy MEM_SCALAR_P as well.
	* stmt.c (expand_decl): Use MEM_SET_IN_STRUCT_P.
	(expand_anon_union_decl): Use MEM_COPY_ATTRIBUTES.
	* varasm.c (make_decl_rtl): Use MEM_SET_IN_STRUCT_P.
	(output_constant_def): Likewise.
	* a29k.c (a29k_set_memflags_1): Take scalar_p.
	Set MEM_SCALAR_P.
	(a29k_set_memflags): Use it.
	* alpha.c (get_aligned_mem): Use MEM_COPY_ATTRIBUTES.
	* c4x.c (c4x_scan_for_ld): Likewise.
	* h8300.c (fix_bit_operand): Likewise.
	* m88k.c (legitimize_address): Likewise.
	(block_move_loop): Likewise.
	(block_move_no_loop): Likewise.
	(block_move_sequence): Likewise.
	(m88k_builtin_saveregs): Use MEM_SET_IN_STRUCT_P.
	* mips/abi64.h (SETUP_INCOMING_VARARGS): Likewise.
	* rs6000.c (expand_block_move_insn): Use MEM_COPY_ATTRIBUTES.
	* sh.c (sh_builtin_saveregs): Use MEM_SET_IN_STRUCT_P.
	* arm.h (arm_gen_load_multiple): Take scalar_p.
	(arm_store_load_multiple): Likewise.
	* arm.c (arm_gen_load_multiple): Likewise.
	(arm_gen_store_multiple): Likewise.
	(arm_gen_movstrqi): Treat MEM_SCALAR_P like MEM_IN_STRUCT_P.

From-SVN: r24759
1999-01-19 10:32:33 +00:00
Stan Cox 157131d73a sh.c (print_operand): lookup interrupt_handler attribute instead of relying on static variable.
* sh.c (print_operand): lookup interrupt_handler attribute instead
of relying on static variable.
* (calc_live_regs): Likewise.
* (sh_pragma_insert_attributes): Create interrupt_handler
attribute if a pragma was specified
* (sh_valid_machine_decl_attribute): Don't set static flag.
* sh.h (PRAGMA_INSERT_ATTRIBUTES): New.

From-SVN: r24265
1998-12-11 11:18:26 +00:00
J"orn Rennecke 1a953d0f16 * sh.c (output_far_jump): Emit braf only for TARGET_SH2.
From-SVN: r24144
1998-12-07 08:18:29 +00:00
J"orn Rennecke 225e4f43cc Add SH4 support:
* config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define.
	(___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define.
	* sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS.
	(fp_reg_names, assembler_dialect): New variables.
	(print_operand_address): Handle SUBREGs.
	(print_operand): Added 'o' case.
	Don't use adj_offsettable_operand on PRE_DEC / POST_INC.
	Name of FP registers depends on mode.
	(expand_block_move): Emit different code for SH4 hardware.
	(prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate.
	(from_compare): Likewise.
	(add_constant): New argument last_value.  Changed all callers.
	(find_barrier): Don't try HImode load for FPUL_REG.
	(machine_dependent_reorg): Likewise.
	(sfunc_uses_reg): A CLOBBER cannot be the address register use.
	(gen_far_branch): Emit a barrier after the new jump.
	(barrier_align): Don't trust instruction lengths before
	fixing up pcloads.
	(machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG.
	Use auto-inc addressing for fp registers if doubles need to
	be loaded in two steps.
	Set sh_flag_remove_dead_before_cse.
	(push): Support for TARGET_FMOVD.  Use gen_push_fpul for fpul.
	(pop): Support for TARGET_FMOVD.  Use gen_pop_fpul for fpul.
	(calc_live_regs): Support for TARGET_FMOVD.  Don't save FPSCR.
	Support for FIRST_XD_REG .. LAST_XD_REG.
	(sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG.
	(sh_expand_epilogue): Likewise.
	(sh_builtin_saveregs): Use DFmode moves for fp regs on SH4.
	(initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account.
	(arith_reg_operand): FPUL_REG is OK for SH4.
	(fp_arith_reg_operand, fp_extended_operand) New functions.
	(tertiary_reload_operand, fpscr_operand): Likewise.
	(commutative_float_operator, noncommutative_float_operator): Likewise.
	(binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise.
	(emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise.
	(expand_df_unop, expand_df_binop, expand_fp_branch): Likewise.
	(emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise.
	* sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only.
	(CONDITIONAL_REGISTER_USAGE): Likewise.
	(HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define.
	(TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define.
	(TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define.
	(target_flag): Add -m4, m4-single, m4-single-only, -mfmovd.
	(OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer
	to -1 and sh_flag_remove_dead_before_cse to 1.
	(ASSEMBLER_DIALECT): Define to assembler_dialect.
	(assembler_dialect, fp_reg_names): Declare.
	(OVERRIDE_OPTIONS): Add code for TARGET_SH4.
	Hide names of registers that are not accessible.
	(CACHE_LOG): Take TARGET_CACHE32 into account.
	(LOOP_ALIGN): Take TARGET_HARWARD into account.
	(FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define.
	(FIRST_PSEUDO_REGISTER: Now 49.
	(FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers.
	(HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG.
	(HARD_REGNO_MODE_OK): Update.
	(enum reg_class): Add DF_REGS and FPSCR_REGS.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise.
	(SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update.
	(CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define.
	(NPARM_REGS): Eight floating point parameter registers on SH4.
	(BASE_RETURN_VALUE_REG): SH4 also passes double values
	in floating point registers.
	(GET_SH_ARG_CLASS) Likewise.
	Complex float types are also returned in float registers.
	(BASE_ARG_REG): Complex float types are also passes in float registers.
	(FUNCTION_VALUE): Change mode like PROMOTE_MODE does.
	(LIBCALL_VALUE): Remove trailing semicolon.
	(ROUND_REG): Round when double precision value is passed in floating
	point register(s).
	(FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are
	passed on the stack.
	(FUNCTION_ARG): Little endian adjustment for SH4 SFmode.
	(FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4.
	(TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account.
	(INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD.
	(MODE_DISP_OK_8): Not for SH4 DFmode.
	(GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode.
	Allow indexed addressing for PSImode after reload.
	(LEGITIMIZE_ADDRESS): Not for SH4 DFmode.
	(LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode.
	Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS.
	(DOUBLE_TYPE_SIZE): 64 for SH4.
	(RTX_COSTS): Add PLUS case.
	Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case.
	(REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS,
	MAC_REGS, PR_REGS, DF_REGS.
	(REGISTER_NAMES): Use fp_reg_names.
	(enum processor_type): Add PROCESSOR_SH4.
	(sh_flag_remove_dead_before_cse): Declare.
	(rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare.
	(PREDICATE_CODES): Add binary_float_operator,
	commutative_float_operator, fp_arith_reg_operand, fp_extended_operand,
	fpscr_operand, noncommutative_float_operator.
	(ADJUST_COST): Use different scale for TARGET_SUPERSCALAR.
	(SH_DYNAMIC_SHIFT_COST): Cheaper for SH4.
	* sh.md (attribute cpu): Add value sh4.
	(attrbutes fmovd, issues): Define.
	(attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv.
	(function units memory, int, mpy, fp): Make dependent on issue rate.
	(function units issue, single_issue, load_si, load): Define.
	(function units load_store, fdiv, gp_fpul): Define.
	(attribute hit_stack): Provide proper default.
	(use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4.
	(udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns.
	(udivsi3, divsi3): Emit special patterns for SH4 hardware,
	(mulsi3_call): Now uses match_operand for function address.
	(mulsi3): Also emit code for SH1 case.  Wrap result in REG_LIBCALL /
	REG_RETVAL notes.
	(push, pop, push_e, pop_e): Now define_expands.
	(push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders.
	(movsi_ie): Added y/i alternative.
	(ic_invalidate_line_i, movdf_i4): New insns.
	(movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters.
	(reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders.
	(movdf): Add special code for SH4.
	(movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible.
	(call_valuei, calli, call_value): Likewise.
	(movsf): Emit no-op move.
	(mov_nop, movsi_y): New insns.
	(blt, sge): generalize to handle DFmode.
	(return predicate): Call emit_fpscr_use and remove_dead_before_cse.
	(block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4.
	(block_move_real_i4, block_lump_real_i4, fpu_switch): New insns.
	(fpu_switch0, fpu_switch1, movpsi): New expanders.
	(fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters.
	(toggle_sz): New insn.
	(addsf3, subsf3, mulsf3, divsf3): Now define_expands.
	(addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns.
	(macsf3): Make use of fpscr visible.  Disable for SH4.
	(floatsisf2): Make use of fpscr visible.
	(floatsisf2_i4): New insn.
	(floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4.
	(ieee_ccmpeqsf_t): Likewise.
	(fix_truncsfsi2): Emit different code for SH4.
	(fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns.
	(cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns.
	(negsf2, sqrtsf2, abssf2): Now expanders.
	(adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders.
	(negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns.
	(muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns.
	(fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders.
	(fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns.
	(fix_truncdfsi2_i4_2+1): New splitters.
	(negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns.
	(extendsfdf2, truncdfsf2): New expanders.
	(truncdfsf2_i4): New insn.
	* t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4.
	(MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4.
	* float-sh.h: When testing for __SH3E__, also test for
	__SH4_SINGLE_ONLY__ .
	* va-sh.h (__va_freg): Define to float.
	(__va_greg, __fa_freg, __gnuc_va_list, va_start):
        Define for __SH4_SINGLE_ONLY__ like for __SH3E__ .
        (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise.
	(__PASS_AS_FLOAT): Use different definition for __SH4__ and
	 __SH4_SINGLE__.
	(TARGET_SH4_P): Define.
	(va_arg): Use it.
	* sh.md (movdf_k, movsf_i): Tweak the condition so that
	init_expr_once is satisfied about the existence of load / store insns.
	* sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie):
        change m constraint in source operand to mr / mf .
	* va-sh.h (__va_arg_sh1): Use __asm instead of asm.
	* (__VA_REEF): Define.
	(__va_arg_sh1): Use it.
	* va-sh.h (va_start, va_arg, va_copy): Add parenteses.

From-SVN: r23777
1998-11-23 08:50:42 +00:00
J"orn Rennecke 913d8e1320 * sh.c (gen_shl_sext): Fix case 5.
From-SVN: r22591
1998-09-25 12:37:01 +01:00
Nick Clifton f43a85cacf update definition/use of HANDLE_PRAGMA to match new specification.
From-SVN: r22451
1998-09-16 12:31:24 +00:00
J"orn Rennecke 61fb6bac57 sh.c (gen_shl_and): Don't sign extend constant for kind two.
* sh.c (gen_shl_and): Don't sign extend constant for kind two.
	Abort if trying to split kind 3 or 4 outside of combine.

From-SVN: r19772
1998-05-15 04:26:52 +01:00
Jeff Law 38e012594e typo typo fixes fixes
From-SVN: r19601
1998-05-06 15:09:07 -06:00
J"orn Rennecke 97d6fd65f3 * sh.c (gen_ashift_hi): Don't make SUBREG of a SUBREG.
From-SVN: r19432
1998-04-27 13:25:51 +01:00
J"orn Rennecke 3d5a082089 sh.c (sh_expand_prologue, [...]): If TARGET_DOUBLE_ALIGN, preserve 64 bit stack alignment.
* sh.c (sh_expand_prologue, sh_expand_epilogue):
        If TARGET_DOUBLE_ALIGN, preserve 64 bit stack alignment.
        * sh.h (STACK_BOUNDARY): Likewise.

From-SVN: r19430
1998-04-27 11:26:39 +01:00
J"orn Rennecke 7174c937fb * (gen_shl_and, in case 1): Fix comparison with mask.
From-SVN: r19400
1998-04-24 09:51:10 +01:00
J"orn Rennecke aec373f1a1 Fix for execute/980205.c failure on SH[123].
* sh.c (sh_expand_prologue, in !SH3E code): Don't push an extra
	register for stdarg functions.
	* sh.h (current_function_varargs): Declare.
	(FUNCTION_ARG): Ignore NAMED for stdarg functions.

From-SVN: r19391
1998-04-23 21:57:06 +01:00
J"orn Rennecke d0c4285986 sh.c (gen_ashift_hi): Implement right shifts via gen_ashift.
* sh.c (gen_ashift_hi): Implement right shifts via gen_ashift.
	* sh.md (ashrhi3_k, lshrhi3_k, lshrhi3_m, lshrhi3, lshrhi3+1): Delete.

From-SVN: r19385
1998-04-23 14:37:16 +01:00
J"orn Rennecke a07987797e Fix some problems that resulted in assmebler messages 'Error: pcrel too far'
Fix some problems that resulted in assmebler messages 'Error: pcrel too far'
	* sh.c (find_barrier): Fix bug in ADDR_DIFF_VEC handling.
	(split_branches): Call init_insn_lengths.

From-SVN: r19339
1998-04-20 11:59:18 +01:00
J"orn Rennecke 1f3fa20e05 * sh.c (find_barrier): Fix calculations for alignemnt increase.
From-SVN: r18853
1998-03-27 10:12:02 +00:00
J"orn Rennecke 77008a4451 sh.h (LOOP_ALIGN): Only align when optimizing.
* sh.h (LOOP_ALIGN): Only align when optimizing.
	* sh.c (find_barrier): Clear inc for CODE_LABELs.
	When not optimizing, calculate alignment for BARRIERs directly.

From-SVN: r18473
1998-03-11 10:33:51 +00:00
Joern Rennecke 25938114e3 Typo fix.
From-SVN: r18449
1998-03-09 12:02:59 +00:00
Joern Rennecke 33f7f35385 rtl.h (addr_diff_vec_flags): New typedef.
* rtl.h (addr_diff_vec_flags): New typedef.
	(union rtunion_def): New member rt_addr_diff_vec_flags.
	(ADDR_DIFF_VEC_FLAGS): New macro.
	* sh.c (output_branch): Fix offset overflow problems.
	* final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE.
	(final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT.
	* rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags).
	* stmt.c (expand_end_case): Supply new arguments to
	gen_rtx_ADDR_DIFF_VEC.
	* 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY.
	* alpha.h, arc.h, clipper.h, convex.h : Likewise.
	* dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise.
	* i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise.
	* mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise.
	* rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise.
	* vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise.
	* i386/386bsd.h, i386/freebsd-elf.h : Likewise.
	* i386/freebsd.h, i386/linux.h : Likewise.
	* i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise.
	* i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise.
	* m68k/mot3300.h, m68k/sgs.h : Likewise.
	* m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise.
	* sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define.
	(CASE_VECTOR_SHORTEN_MODE): Define.
	(short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare.
	(med_branch_p, braf_branch_p): Don't declare.
	(mdep_reorg_phase, barrier_align): Declare.
	(ADJUST_INSN_LENGTH): Remove alignment handling.
	* sh.c (uid_align, uid_align_max): Deleted.
	(max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted.
	(short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted.
	(cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted.
	(output_far_jump): Don't use braf_branch_p.
	(output_branchy_insn): Don't use branch_offset.
	(find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs.
	Remove paired barrier stuff.
	Don't use cache_align_p.
	Take alignment insns into account.
	(fixup_addr_diff_vecs): Reduce to only fixing up the base label of
	the addr_diff_vec.
	(barrier_align, branch_dest): New function.
	(machine_dependent_reorg, split_branches): Remove infrastructure
	for branch shortening that is now provided in the backend.
	* sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes.
	(braf_branch_p, braf_cbranch_p): Likewise.
	(attribute length): Use new attributes.
	(casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC.
	(addr_diff_vec_adjust): Delete.
	(align_2): Now a define_expand.
	(align_log): Now length 0.

From-SVN: r18433
1998-03-06 14:54:07 +00:00
Jeff Law 956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
J"orn Rennecke 4d7b7169c5 sh.c (final_prescan_insn): Use local label prefix when emitting .uses pseudo-ops.
* sh.c (final_prescan_insn): Use local label prefix
        when emitting .uses pseudo-ops.

From-SVN: r16949
1997-12-04 17:45:10 +00:00
J"orn Rennecke 1245df60c1 Sync SH port with FSF; enable regmove for SH.
From-SVN: r16371
1997-11-08 19:54:57 +00:00
Jeff Law 07f5b9aa23 sh.c (sh_expand_epilogue): Emit a blockage insn before cutting back the stack.
* sh.c (sh_expand_epilogue): Emit a blockage insn before
        cutting back the stack.

From-SVN: r14362
1997-06-30 14:56:46 -06:00