Commit Graph

492 Commits

Author SHA1 Message Date
Richard Henderson 3f62235327 configure.in (ia64-*): Set float_format for i386 long double.
* configure.in (ia64-*): Set float_format for i386 long double.

	* real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT
	as we would for i386 XFmode.
	(PUT_REAL): Likewise.
	(endian, ereal_atof, real_value_truncate): Likewise.
	(ereal_isneg, toe64, etens, make_nan): Likewise.
	* real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise.

	* config/ia64/ia64-protos.h: Update.
	* config/ia64/ia64.c (general_tfmode_operand): New.
	(destination_tfmode_operand): New.
	(tfreg_or_fp01_operand): New.
	(ia64_split_timode): New.
	(spill_tfmode_operand): New.
	(ia64_expand_prologue): Use TFmode not XFmode.
	(ia64_expand_epilogue): Likewise.
	(ia64_function_arg): Likewise.
	(ia64_function_arg_advance): Likewise.
	(ia64_return_in_memory): Likewise.
	(ia64_function_value): Likewise.
	(ia64_print_operand): Likewise.
	(ia64_register_move_cost): Set GR<->FR to 5.
	(ia64_secondary_reload_class): Get GR for TImode memory op.
	* config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove.
	(ROUND_TYPE_ALIGN): Remove.
	(LONG_DOUBLE_TYPE_SIZE): Set to 128.
	(INTEL_EXTENDED_IEEE_FORMAT): Define.
	(HARD_REGNO_NREGS): Use TFmode, not XFmode.
	(HARD_REGNO_MODE_OK): Likewise.  Disallow TImode in FRs.
	(MODES_TIEABLE_P): Use TFmode, not XFmode.
	(CLASS_MAX_NREGS): Likewise.
	(ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks.
	(PREDICATE_CODES): Update.
	* config/ia64/ia64.md (movti): New.
	(movti_internal): Use a clobber for memory alternatives.
	(reload_inti, reload_outti): New.
	(movsfcc_astep): Predicate properly.
	(movdfcc_astep): Likewise.
	(movxf): Remove.
	(movtf): New.
	(extendsftf2, extenddftf2): New.
	(trunctfsf2, trunctfdf2): New.
	(floatditf2, fix_trunctfdi2): New.
	(floatunsditf2, fixuns_trunctfdi2): New.
	(addtf3, subtf3, multf3, abstf2): New.
	(negtf2, nabstf2, mintf3, maxtf3): New.
	(maddtf3, msubtf3, nmultf3, nmaddtf3): New.
	(cmptf): New.
	(fr_spill): Use TFmode, not XFmode.
	(fr_restore): Likewise.
	* config/ia64/lib1funcs.asm (__divtf3): New.
	* config/ia64/t-ia64 (LIB1ASMFUNCS): Add it.

From-SVN: r35689
2000-08-14 14:01:24 -07:00
Richard Henderson 870f9ec0bc ia64.c (do_spill): Pass cfa offset to move expander.
* config/ia64/ia64.c (do_spill): Pass cfa offset to move expander.
        (do_restore): Likewise.
        (gen_movdi_x, gen_fr_spill_x, gen_fr_restore_x): New.
        (ia64_expand_prologue, ia64_expand_epilogue): Use them.
        (rtx_needs_barrier): Track actual bit manipulation for
        ar.unat moves, gr_spill, and gr_restore.
        (emit_insn_group_barriers): Special case gr_spill/gr_restore.
        (process_set): Don't handle varargs spills.
        * config/ia64/ia64.md (gr_spill): Accept cfa offset.  Emit
        .mem.offset here instead of in process_set.
        (gr_restore): Likewise.

From-SVN: r35648
2000-08-11 16:10:10 -07:00
Richard Henderson 97e242b0a7 ia64-protos.h: Remove duplicates.
* config/ia64/ia64-protos.h: Remove duplicates.  Update
	for massive code rearrangements.
	* config/ia64/ia64.c (ia64_arpfs_regno): Remove.
	(ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove.
	(ia64_local_regs, ia64_need_regstk): Remove.
	(ar_ccv_reg_operand): New.
	(ia64_gp_save_reg): New.
	(struct ia64_frame_info): Combine most of the size elements;
	add new gr save elements.
	(find_gr_spill): New.
	(next_scratch_gr_reg): New.
	(mark_reg_gr_used_mask): New.
	(ia64_compute_frame_size): Rewrite.  Allocate special AR regs
	to GR backing store regs when possible.
	(ia64_initial_elimination_offset): New.
	(ia64_rap_fp_offset): Remove.
	(save_restore_insns): Remove.
	(setup_spill_pointers): New.
	(finish_spill_pointers): New.
	(spill_restore_mem): New.
	(do_spill, do_restore): New.
	(ia64_expand_prologue): Rewrite to use them.
	(ia64_expand_epilogue): Likewise.
	(ia64_direct_return): Update for current_frame_info changes.
	(ia64_function_prologue): Simplify .prologue emission.  Emit
	.spill when needed.
	(ia64_setup_incoming_varargs): Don't ever emit rtl.
	(ia64_dbx_register_number): New.
	(ia64_initialize_trampoline): New.
	(ia64_secondary_reload_class): Request GR_REGS for integer
	arithmetic destined for FR_REGS.
	(ia64_init_machine_status): Don't reset return_address_pointer_rtx.
	(ia64_mark_machine_status): Mark ia64_gp_save.
	(rws_access_regno): Rename from rws_access_reg; don't treat
	predicates specially.
	(rws_access_reg): New.  Update all callers.
	(rtx_needs_barrier): Remove dead unspecs.
	(ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit.
	(ia64_encode_section_info): Silence signed/unsigned warnings.
	(spill_offset, sp_offset, spill_offset_emitted): Remove.
	(tmp_reg, tmp_saved): Remove.
	(process_set): Rewrite to expect complicated bits via
	REG_FRAME_RELATED_EXPR.
	(ia64_expand_fetch_and_op): Use emit_move_insn; be explicit
	in the use of ar.ccv; never set RTX_UNCHANGING_P.
	(ia64_expand_op_and_fetch): Likewise.
	(ia64_expand_compare_and_swap): Likewise.
	(ia64_expand_builtin): Likewise.
	* config/ia64/ia64.h (AR_UNAT_REGNUM): New.
	(FIRST_PSEUDO_REGISTER): Update.
	(AR_M_REGNO_P): Update.
	(FIXED_REGS): Don't mark three local registers as used.
	(EXTRA_CC_MODES): New.
	(SELECT_CC_MODE): New.
	(HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode.
	(HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates.
	(FRAME_GROWS_DOWNWARD): Unset.
	(STARTING_FRAME_OFFSET): Zero.
	(ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer.
	(INITIAL_ELIMINATION_OFFSET): Defer to out of line function.
	(HARD_FRAME_POINTER_REGNUM): New.
	(CAN_DEBUG_WITHOUT_FP): Define.
	(TRAMPOLINE_TEMPLATE): Remove.
	(TRAMPOLINE_SIZE): Lower to 32.
	(TRAMPOLINE_ALIGNMENT): Lower to 64.
	(INITIALIZE_TRAMPOLINE): Defer to out of line function.
	(PREDICATE_CODES): Update.
	(struct machine_function): Add ia64_gp_save.
	* config/ia64/ia64.md: Purge unused unspecs.
	(movsi patterns): Allow moves to/from AR_M_REGS.
	(movdi patterns): Allow moves to/from p0.
	(call patterns): Move most setjmp hackery to ia64_gp_save_reg.
	(gr_spill, gr_restore): Indicate ar.unat read/written.
	(nonlocal_goto): Don't pass old frame_pointer.
	(nonlocal_goto_receiver): Remove.
	(exception_receiver): New.
	(builtin_setjmp_setup): New.
	(builtin_setjmp_receiver): New.
	* config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle.
	(__ia64_nonlocal_goto): Bundle.  Don't kill r7.
	(__ia64_restore_stack_nonlocal): Likewise.
	(__ia64_trampoline): New.
	* config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line
	function.
	* config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline.

From-SVN: r35568
2000-08-08 03:01:20 -07:00
Jim Wilson 7d17b34de5 Finish ABI change started by last patch, this time I tested it.
* config/ia64/ia64.c (ia64_function_arg): Fix last change.  Verify
	type exists before using it.  Use number of words as alignment
	otherwise.
	(ia64_function_arg_partial_nregs, ia64_function_arg_advance,
	ia64_va_arg): Propagate ia64_function_args changes here.

From-SVN: r35413
2000-08-01 15:23:56 -07:00
Jim Wilson f9f45ccb5f Adjust structure parameter passing to match ABI change.
* config/ia64/ia64.c (ia64_function_arg): Use alignment not size
	when computing offset.

From-SVN: r35401
2000-07-31 20:22:53 -07:00
Richard Henderson 5527bf14a5 Makefile.in (OBJS): Add doloop.o.
* Makefile.in (OBJS): Add doloop.o.
	* doloop.c: New file.

	* final.c (insn_current_reference_address): Return 0 before final.
	* flags.h (flag_branch_on_count_reg): Fix typos in commentary.
	* jump.c (any_uncondjump_p): Likewise.
	* loop.c (indirect_jump_in_function): Make static.
	(strength_reduce): Call doloop_optimize.
	(insert_bct, instrument_loop_bct): Remove.
	* loop.h (doloop_optimize): Prototype.
	* recog.c (split_all_insns): Split all INSN_P.
	* toplev.c (flag_branch_on_count_reg): Default on.

	* config/c4x/c4x.c (c4x_optimization_options): Don't set
	flag_branch_on_count_reg.
	* config/i386/i386.c (override_options): Likewise.
	* config/rs6000/rs6000.c (optimization_options): Likewise.

	* config/i386/i386.md (decrement_and_branch_on_count): Remove.
	(doloop_end): New.
	(dbra_ge): Remove, as well as all it's splitters.

	* config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove.
	(doloop_end): New.

	* config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare.
	(ia64_register_move_cost): Declare.
	* config/ia64/ia64.c (ar_lc_reg_operand): New.
	(struct ia64_frame_info): Add ar_size.
	(ia64_compute_frame_size): Set it.
	(save_restore_insns): Save and restore ar.lc.
	(ia64_register_move_cost): New, moved from header file.  Handle
	application registers.
	(REG_AR_PFS, REG_AR_EC): Remove.  Replace with AR_*_REGNUM numbers.
	(emit_insn_group_barriers): Special case doloop_end_internal.
	(ia64_epilogue_uses): Mark ar.lc live at end.
	* config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers.
	(AR_EC_REGNUM, AR_PFS_REGNUM): New registers.
	(FIRST_PSEUDO_REGISTER): Make room.
	(AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New.
	(FIXED_REGISTERS, CALL_USED_REGISTERS): Update.
	(REG_ALLOC_ORDER): Update.
	(HARD_REGNO_MODE_OK): Update.
	(REGISTER_NAMES): Update.
	(enum reg_class): Add AR_M_REGS and AR_I_REGS.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update.
	(REGNO_REG_CLASS): Update.
	(LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10.
	(REGISTER_MOVE_COST): Move out of line.
	(PREDICATE_CODES): Update.
	* config/ia64/ia64.md (movdi patterns): Handle ar register classes.
	(addsi3_plus1_alt, adddi3_plus1_alt): New.
	(shladd_elim splitter): Allow constants in the predicate.
	(doloop_end, doloop_end_internal): New.

From-SVN: r35358
2000-07-30 16:58:03 -07:00
Richard Henderson 08012cdae4 ia64.c (ia64_print_operand): Fix typos.
* config/ia64/ia64.c (ia64_print_operand): Fix typos.
        Sign extend mode size before negating.

From-SVN: r35324
2000-07-28 12:46:18 -07:00
Richard Henderson 4b983fdc50 cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY.
* cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY.
	(cse_insn): Likewise.
	(addr_affects_sp_p): Likewise.
	* expr.c (move_by_pieces): Likewise.
	(clear_by_pieces): Likewise.
	* gcse.c (oprs_unchanged_p): Likewise.
	* haifa-sched.c (sched_analyze_2): Likewise.
	* recog.c (offsettable_address_p): Likewise.
	* regclass.c (record_address_regs): Likewise.
	* reload.c (find_reusable_reload): Likewise.
	(push_reload): Likewise.
	(operands_match_p): Likewise.
	(decompose): Likewise.
	(find_reloads_address_1): Likewise.
	(find_inc_amount): Likewise.
	* reload1.c (elimination_effects): Likewise.
	* resource.c (mark_set_resources): Likewise.
	* flow.c (attempt_auto_inc): New function; mostly broken out
	of find_auto_inc.
	(find_auto_inc): Split into two functions and enhanced to
	generate POST_MODIFY.
	* rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment.
	* rtl.h (count_all_occurrences):  Declare.
	(HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not
	defined.
	* rtlanal.c (count_all_occurrences): New function.
	* tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP,
	HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document.

	* config/ia64/ia64-protos.h (destination_operand): Declare.
	* config/ia64/ia64.c (destination_operand): New function.
	(ia64_print_operand): Handle POST_MODIFY.
	(rtx_needs_barrier): Likewise.
	* config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1.
	(HAVE_POST_MODIFY_REG): Define to 1.
	(MAX_REGS_PER_ADDRESS): Change to 2.
	(GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too.
	(LEGITIMATE_ADDRESS_REG): New helper macro.
	(LEGITIMATE_ADDRESS_DISP): Likewise.
	(PREDICATE_CODES): Add entry for destination_operand.
	* config/ia64/ia64.md (all mov patterns): Use destination_operand
	predicate for operand 0.

From-SVN: r35321
2000-07-28 10:46:18 -07:00
Richard Henderson 6f8aa100d5 ia64.c (ia64_print_operand): Handle "%,".
* config/ia64/ia64.c (ia64_print_operand): Handle "%,".
        * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): Likewise.
        * config/ia64/ia64.md (movdi_internal): Use it.

From-SVN: r35240
2000-07-24 17:48:36 -07:00
Richard Henderson 9b7bf67dad ia64.md (movdi): Split out load address code.
* config/ia64/ia64.md (movdi): Split out load address code.
        New post-reload splitter for symbolic operands.
        (movdi_internal): Abort if we didn't split symbolic operands
        when we should have.
        * config/ia64/ia64.c (ia64_expand_load_address): New, from movdi bits.
        (ia64_reorg): Split insns when not optimizing.
        * config/ia64/ia64-protos.h (ia64_expand_load_address): Declare.

From-SVN: r35106
2000-07-17 15:19:58 -07:00
Richard Henderson 557b9df529 ia64-protos.h (ia64_move_ok): Prototype.
* config/ia64/ia64-protos.h (ia64_move_ok): Prototype.
        * config/ia64/ia64.c (ia64_move_ok): New function.
        * config/ia64/ia64.md (movqi, movqi_internal): Use it.
        (movhi, movsi, movdi, movsf, movdf, movxf): Likewise.

From-SVN: r35054
2000-07-15 13:31:27 -07:00
Richard Henderson ec039e3c26 ia64.c (got_symbolic_operand): New.
* config/ia64/ia64.c (got_symbolic_operand): New.
        (symbolic_operand, move_operand): Revert 0701 change.
        * config/ia64/ia64.h (PREDICATE_CODES): Update.
        * config/ia64/ia64-protos.h (got_symbolic_operand): Declare.
        * config/ia64/ia64.md (movdi): Revert 0701 wrt symbolic_operand;
        split the offset into a 14-bit low part instead of a 13-bit low part.
        (load_fptr): Mark the mem as unchanging.
        (load_symptr): Use got_symbolic_operand.

From-SVN: r34948
2000-07-10 13:51:23 -07:00
Jim Wilson 12c2c7aa82 Fix glibc -O2 iso646.i abort.
* config/ia64/ia64.c (rws_access_reg): New local write_count.  If
	is_predicate_reg, then take max write_count of register pair.

From-SVN: r34915
2000-07-07 16:43:28 -07:00
Richard Henderson dee4095a02 ia64.c (symbolic_operand): Reject CONST expressions with the low 13 bits set.
* config/ia64/ia64.c (symbolic_operand): Reject CONST expressions
        with the low 13 bits set.
        (move_operand): Check for CONST|SYMBOL_REF|LABEL_REF directly.
        * config/ia64/ia64.md (movdi): Likewise.  Expand a CONST with one
        of the low 13 bits into a CONST plus an adddi3.
        (load_symptr): Set RTX_UNCHANGING_P.

From-SVN: r34821
2000-07-01 14:20:32 -07:00
Richard Henderson e57b9d6566 ia64.c (emit_insn_group_barriers): Special case epilogue_deallocate_stack.
* config/ia64/ia64.c (emit_insn_group_barriers): Special case
        epilogue_deallocate_stack.

        * config/ia64/ia64.c (ia64_print_operand) [case D]: Emit
        completers for UNORDERED and ORDERED as well.
        * config/ia64/ia64.md (bunordered, bordered): New.
        (sunordered, sordered): New.

From-SVN: r34734
2000-06-27 10:36:59 -07:00
Richard Henderson 054451eaca ia64.md (pred_rel_mutex): Only take one register.
* config/ia64/ia64.md (pred_rel_mutex): Only take one register.
        * config/ia64/ia64.c (emit_predicate_relation_info): Adjust to match.

From-SVN: r34661
2000-06-23 01:35:58 -07:00
Richard Henderson 3b572406c2 ia64-protos.h (process_for_unwind_directive): Declare.
* config/ia64/ia64-protos.h (process_for_unwind_directive): Declare.
	(ia64_file_start): Declare.
	* config/ia64/ia64.h (ADDL_REGNO_P): Don't compare unsigned against 0.
	(GR_REGNO_P): Likewise.
	* config/ia64/ia64.c: Many prototypes.
	(ia64_reg_numbers): Constify.
	(ia64_input_reg_names, ia64_local_reg_names): Likewise.
	(ia64_section_threshold): Make unsigned.
	(ia64_print_operand): Constify.
	(fix_range): Constify.
	(ia64_init_builtins): Don't compare signed vs unsigned.
	(ia64_expand_builtin): Likewise.

	* config/ia64/ia64.h (EXTRA_CONSTRAINT): New.
	(CONSTRAINT_OK_FOR_Q): New.
	* config/ia64/ia64.md (movdi_internal): Use Q for fp<->mem.
	(movsf_internal, movdf_internal): Likewise.
	(cmovdi_internal): Rewrite so that constraints and predicates match;
	simplify splitters.
	(cmovsi_internal): Likewise.

	* config/ia64/ia64.h (ASM_SPEC): Add -x for gas.
	(ASM_FILE_START): New.
	* config/ia64/ia64.c (ia64_file_start): New.
	(rtx_needs_barrier): Handle pred.rel.mutex.
	(emit_predicate_relation_info): New.
	* config/ia64/ia64.md (pred_rel_mutex): New.
	* config/ia64/linux.h (ASM_SPEC): Define.
	* config/ia64/sysv4.h (ASM_FILE_START): Define.

	* config/ia64/ia64.c (ia64_encode_section_info): Fix thinko
	filtering global register variables.

From-SVN: r34589
2000-06-18 11:54:43 -07:00
Richard Henderson d98a8d38dd conflict.c (conflict_graph_compute): Don't look for REG_INC.
* conflict.c (conflict_graph_compute): Don't look for REG_INC.

        * config/ia64/ia64.c (ia64_setup_incoming_varargs): Don't emit
        auto-inc code.

From-SVN: r34557
2000-06-14 14:08:15 -07:00
Richard Henderson 46327bc509 libgcc2.c (ia64_throw_helper): Use __builtin_return_address.
* libgcc2.c (ia64_throw_helper): Use __builtin_return_address.
        (__throw): Don't pass the address of a label.

        * config/ia64/ia64.c (ia64_compute_frame_size): Use
        current_function_is_leaf.
        (ia64_expand_prologue): Likewise.  Modify return_address_pointer_rtx
        instead of reg_names[RETURN_ADDRESS_REGNUM].
        (ia64_init_machine_status): Reset return_address_pointer_rtx.
        * config/ia64/ia64.h (RETURN_ADDRESS_POINTER_REGNUM): Rename
        from RETURN_ADDRESS_REGNUM.  Update all uses.
        (RETURN_ADDR_RTX): Use return_address_pointer_rtx; return
        zero instead of null on failure.
        (ELIMINABLE_REGS): Add ra->b0 elimination.
        (CAN_ELIMINATE): Update accordingly.
        (INITIAL_ELIMINATION_OFFSET): Likewise.
        (REGISTER_NAMES): Use an illegal assembler name for
        RETURN_ADDRESS_POINTER_REGNUM.

From-SVN: r34531
2000-06-13 16:36:19 -07:00
Richard Henderson 13da91fd23 ia64.h (enum reg_class): Remove FR_INT_REGS, FR_FP_REGS, GR_AND_FR_INT_REGS, GR_AND_FR_FP_REGS.
* config/ia64/ia64.h (enum reg_class): Remove FR_INT_REGS, FR_FP_REGS,
        GR_AND_FR_INT_REGS, GR_AND_FR_FP_REGS.
        (REG_CLASS_NAMES): Likewise.
        (REG_CLASS_CONTENTS): Likewise.
        (FR_FP_REGNO_P, FR_INT_REGNO_P): Remove.
        (HARD_REGNO_MODE_OK): Remove references to them.
        (REGNO_REG_CLASS): Likewise.
        (REG_CLASS_FROM_LETTER): Likewise.
        (CLASS_MAX_NREGS): Likewise.
        (REGISTER_MOVE_COST): Likewise.
        * config/ia64/ia64.c (ia64_secondary_reload_class): Likewise.
        * config/ia64/ia64.md (*): Replace "e" constraints with "f".
        (movqi_internal): Special case moves from zero.
        (movhi_internal, movsi_internal): Likewise.
        (movdi_internal): Likewise.  Fill out "f" constraints.
        (movsf_internal): Fill out "r" constraints.
        (movdf_internal): Likewise.

From-SVN: r34530
2000-06-13 16:19:50 -07:00
James E. Wilson 0186257f78 Add unwind support for epilogues, because the kernel unwinder needs them.
* config/ia64/ia64-protos.h (ia64_output_end_prologue): Add.
	(output_function_prologue): Fix mispelling.
	(output_function_prologue, output_function_epilogue): Reorder to
	match ia64.c definition order.
	* config/ia64/ia64.c (ia64_expand_prologue): Add comment.
	(ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on stack restore insns.
	Use r3 instead of r2 for large stack restores.
	(ia64_output_end_prologue): New function.
	(process_set): Emit ".restore sp" for epilogue stack restores.
	* config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Define.

From-SVN: r34456
2000-06-08 10:15:32 -07:00
James E. Wilson c0240be463 Fix gas/gcc unwind/EH discrepancies. And a shared library build problem.
* frame.h (struct unwind_info_ptr): Collapse version, flags, and length
	fields into header field.
	(IA64_UNW_HDR_LENGTH, IA64_UNW_HDR_FLAGS, IA64_UNW_HDR_VERSION): New
	macros to access length, flags, and version info from header field.
	* config/ia64/crtbegin.asm (__do_frame_setup_aux): Delete here.
	...

From-SVN: r34441
2000-06-06 19:27:51 -07:00
Richard Henderson ac9cd70f20 ia64.c (sdata_symbolic_operand): Consider small CONSTANT_POOL_ADDRESS_P addresses for .sdata.
* config/ia64/ia64.c (sdata_symbolic_operand): Consider small
        CONSTANT_POOL_ADDRESS_P addresses for .sdata.
        * config/ia64/sysv4.h (SELECT_RTX_SECTION): New.

From-SVN: r34319
2000-05-31 17:14:13 -07:00
Richard Henderson 85548039c4 ia64-protos.h (ia64_expand_prediction): Remove.
* config/ia64/ia64-protos.h (ia64_expand_prediction): Remove.
        * config/ia64/ia64.c (ia64_expand_prediction): Move code ...
        (ia64_print_operand) [+]: ... here.  Use current_output_insn.
        * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): New.
        * config/ia64/ia64.md (all branch/call patterns): Use %+.

From-SVN: r34318
2000-05-31 17:10:35 -07:00
Andrew MacLeod ce152ef836 except.c (func_eh_entry): Add emitted field.
2000-05-25  Andrew MacLeod  <amacleod@cygnus.com>
            Andrew Haley  <aph@cygnus.com>

	* except.c  (func_eh_entry): Add emitted field.
	(new_eh_region_entry): Set emitted field to 0;
	(output_exception_table_entry): Only emit previously un-emitted data,
	and send it to the eh_data section.
	(output_exception_table): Break out common parts. Output
	exception table for entire compilation unit to eh_data section.
	(output_exception_table_data): Common parts of output_exception_table.
	Send output to eh_data section.
	(output_function_exception_table): Output exception table data for
	a single function to eh_data section.
	(free_exception_table): New external to free the table.
	* except.h (free_exception_table): Add prototype.
	(output_function_exception_table): Add prototype.
	* final.c (final_end_function): Output function exception table
	for IA64_UNWIND_INFO.
	(final_scan_insn): Emit any unwind directives for an insn.

	* frame-dwarf2.c: New file containing all DWARF 2 specific code
	from frame.c.
	* frame.c: Remove all DWARF 2 specific code.
	* config/ia64/frame-ia64.c: New file.
	(gthread_stuff): Make all gthread available with
	IA64_UNWIND_INFO.
	(dwarf_fde): Define an IA64 struct for dwarf_fde.
	(__register_frame_info, __register_frame): Move to common area of file.
	(__register_frame_info_table, __register_frame_table): Move to common i
	area.
	(__deregister_frame_info, __deregister_frame): Move to common area.
	(__frame_init, find_fde): New versions for IA64_UNWIND_INFO.
	(read_uleb128): New version for ia64.
	(get_unwind_record): Read the next IA-64 unwind record.
	(read_R_record): Read a region header record.
	(process_a_b_reg_code): X record helper.
	(read_X_record): Read an X format record.
	(read_B_record): Read a B format record.
	(P3_record_types): List of record types matching the P3 format.
	(P7_record_types): List of record types matching the P7 format.
	(P8_record_types): List of record types matching the P8 format.
	(read_P_record): Read a P format record.
	(init_ia64_reg_loc): Set default fields for a register.
	(init_ia64_unwind_frame): Set defaults for all register records.
	(execute_one_ia64_descriptor): Execute one descriptor record.
	(rse_address_add): Calculate the position of a local reg in memory.
	(normalize_reg_loc): Turn a location descriptor into a memory address.
	(maybe_normalize_reg_loc): Only normalize a descriptor if it falls
	within a specified PC offset range.
	(get_real_reg_value): Given a register location, retrieve its value.
	(set_real_reg_value): Change the value of a register location.
	(copy_reg_value): Copy reg values, if needed.
	(copy_saved_reg_state): Copy all registers that need to be copied.
	(process_state_between): Normalize all frame register records that
	fall within the specified PC range.
	(frame_translate): Take a processed frame description, and turn
	everything into addresses.
	(build_ia64_frame_state ): Find and create frame state record for a PC.
	(get_personality): Get the personality routine for a given frame.
	(get_except_table): Get the exception table for a given frame.
	(record_name): Unwind record names for debugging.
	(print_record): Print and unwind record.
	(print_all_records): Print an entire unwind image.
	(__ia64_backtrace): Print a backtrace.
	(ia64_backtrace_helper): New function.
	(__register_frame_info_aux): New function.
	* config/ia64/crtend.asm (__do_frame_setup_aux): New function.

	* frame.h (enum unw_record_type): New unwind record types.
	(struct unw_p_record, unw_b_record, unw_x_record) : New unwind records.
	(struct unw_r_record, unwind_record): New unwind record structs.
	(struct unwind_info_ptr): Unwind information layout.
	(IA64_UNW_LOC_TYPE_*): Macros for different types for location
	descriptors.
	(struct ia64_reg_loc): Register location description.
	(struct ia64_frame_state): Location of all registers in a frame.
	(struct object): Add pc_base and fde_end for IA64_UNWIND_INFO.
	* libgcc2.c (__ia64_personality_v1): Personality routine.
	(__calc_caller_bsp): Calculate the bsp register for the caller's
	frame.
	(ia64_throw_helper): Figure out who to return to and set up the
	registers.
	(__throw): Throw routine.

	* output.h (assemble_eh_align, assemble_eh_label): New functions
	to generate EH info where we want it.
	(assemble_eh_integer): New function.
	* toplev.c (compile_file): Output module level exception table for
	non-ia64 targets.
	(main): Set exceptions_via_longjump and flag_new_exceptions based
	on IA64_UNWIND_INFO too.

	* varasm.c (assemble_eh_label): Generate a label via
	ASM_OUTPUT_EH_LABEL if it has been specified.
	(assemble_eh_align): Generate an alignment directive via
	ASM_OUTPUT_EH_ALIGN if it has been specified.
	(assemble_eh_label): Generate an integer value via
	ASM_OUTPUT_EH_type if they have been specified.
	* config/ia64/ia64.c (rtx_needs_barrier): Add flushrs.
	(ia64_init_builtins): Add __builtin_ia64_bsp
	and __builtin_ia64_flushrs.
	(ia64_expand_builtin): Add IA64_BUILTIN_BSP and
	IA64_BUILTIN_FLUSHRS.
	* config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and
	IA64_BUILTIN_FLUSHRS.

	* config/ia64/ia64.md (flushrs): New insn to flush the register
	stack.  Add to unspec list.

	* config/ia64/crtbegin.asm (frame_object): Change size.
	(__do_frame_setup_aux): New function.
	* config/ia64/crtend.asm: call __do_frame_setup_aux.
	* config/ia64/t-ia64 (LIB2ADDEH): Add.
	* Makefile.in (LIB2ADDEH): Add.
	(LIB2ADD): Use LIB2ADDEH.

Co-Authored-By: Andrew Haley <aph@cygnus.com>

From-SVN: r34169
2000-05-25 15:21:51 +00:00
Richard Henderson 6b6c1201e6 ia64-protos.h (ia64_expand_prediction): Declare.
* config/ia64/ia64-protos.h (ia64_expand_prediction): Declare.
        * config/ia64/ia64.c (ia64_print_operand_address): Handle 'j'.
        (ia64_expand_prediction): New.
        (emit_insn_group_barriers): Don't look at notes.  Emit barriers
        as needed after calls.
        (ia64_epilogue_uses): Mark b0 used.
        * config/ia64/ia64.md (beq_true, beq_false): Remove.
        (bne_true, bne_false): Remove.
        (eq_return, eq_not_return, ne_return, ne_not_return): Remove.
        (br_true, br_false): New.  Use predicate_operator and
        ia64_expand_prediction.
        (return_true, return_false): Likewise.
        (call_internal): Use ia64_expand_prediction.  Don't emit stop bit.
        (call_internal1, call_value_internal): Likewise.
        (call_value_internal1, call_multiple_values_internal1): Likewise.

From-SVN: r33793
2000-05-08 23:17:35 -07:00
Richard Henderson 4a7270f207 * config/ia64/ia64.c (ia64_direct_return): Require frame size zero.
From-SVN: r33788
2000-05-08 23:06:18 -07:00
Richard Henderson 549f072574 ia64.c (ia64_encode_section_info): Exit early for global register variables...
* config/ia64/ia64.c (ia64_encode_section_info): Exit early
        for global register variables; don't special case __[CD]TOR_LIST__;
        mind ggc_p for string allocation.

From-SVN: r33776
2000-05-08 15:08:25 -07:00
Richard Henderson e5bde68ae0 ia64.c (predicate_operator): New.
* config/ia64/ia64.c (predicate_operator): New.
        (ia64_print_operand): Handle 'J'.
        (rtx_needs_barrier): Handle COND_EXEC.
        * config/ia64/ia64.h (BRANCH_COST): Define.
        (PREDICATE_CODES): Update.
        * config/ia64/ia64.md: Docuement used unspec values.
        (attr predicable): New.
        (movxf, movxf_internal): New.
        (extendsfdf2): Don't comment out nop.
        (floatdidf2): Remove.
        (truncxfsf2, truncxfdf2, floatdixf2): New.
        (abssi2, absdi2): Put the neg in the "true" slot.
        (conditional branch instructions): Mark not predicable.
        (cmov*_internal): Use predicate_operator.  Split to cond_exec.
        (abs*_internal): Likewise.
        (alloc, set_bsp): Mark not predicable.
        (barrier, insn_group_barrier, flush_cache): Likewise.
        (define_cond_exec): New.

From-SVN: r33754
2000-05-06 18:56:25 -07:00
Richard Henderson fd7c34b081 ia64.c (sdata_symbolic_operand): Mark unused args.
* config/ia64/ia64.c (sdata_symbolic_operand): Mark unused args.
        (symbolic_operand, function_operand, setjmp_operand): Likewise.
        (shift_count_operand, shift_32bit_count_operand): Likewise.
        (shladd_operand, fetchadd_operand, ia64_function_prologue): Likewise.
        (ia64_function_epilogue, ia64_setup_incoming_varargs): Likewise.
        (ia64_function_arg_partial_nregs, ia64_function_value): Likewise.
        (ia64_print_operand_address, ia64_secondary_reload_class): Likewise.
        (ia64_expand_builtin): Likewise.
        (call_multiple_values_operation): Make dest_regno unsigned.

From-SVN: r33753
2000-05-06 18:46:22 -07:00
Richard Henderson 809d4ef105 c-decl.c: Include "tm_p.h".
* c-decl.c: Include "tm_p.h".

        * config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness.
        (fetchadd_operand, ia64_expand_fetch_and_op): Declare.
        (ia64_expand_op_and_fetch): Declare.
        * config/ia64/ia64.c: Include "toplev.h".  Kill trailing whitespace.
        (setjmp_operand): Constify variables for XSTR.
        (ia64_encode_section_info): Likewise.
        (ia64_print_operand): Use %d for exact_log2; cast 32-bit printed
        values to int.
        (ia64_asm_output_external): Constify name.
        (process_set): Use HOST_WIDE_INT_PRINT_DEC for frame size.
        (process_for_unwind_directive): Provide switch default.
        (ia64_expand_compare_and_swap): Remove unused variables.
        (ia64_expand_builtin): Likewise.
        * config/ia64/ia64.h (ASM_OUTPUT_BYTE): Mask and cast value to int
        for printing.

From-SVN: r33752
2000-05-06 18:37:07 -07:00
Jim Wilson 59da9a7d5c Patches from David Mosberger, and a patch to make bootstrap work.
* config/ia64/ia64.c (ia64_encode_section_info): Add check for
	TREE_ASM_WRITTEN.
	* config/ia64/ia64.c (ia64_override_options): Force -mconstant-gp
	if -mauto-pic is on.
	...

From-SVN: r33638
2000-05-03 11:46:05 -07:00
Andrew Haley 32adf8e626 ia64.c (ia64_encode_section_info): Handle the case where this function is called for the second time on a decl...
2000-05-02  Andrew Haley  <aph@cygnus.com>

        * config/ia64/ia64.c (ia64_encode_section_info): Handle the case
        where this function is called for the second time on a decl that
        has had its section info changed in such a way as to move it out
        of small data/bss.
        * config/ia64/ia64.h (REDO_SECTION_INFO_P): New definition.

From-SVN: r33609
2000-05-02 13:50:25 +00:00
Andrew MacLeod 0c96007e77 Add partial support for IA-64 unwind sections.
* config/ia64/crtbegin.asm: Add IA-64 unwind support.  Correct alloc
	and gp save/restore problems.
	* config/ia64/crtend.asm: Add IA-64 unwind support.
	* config/ia64/ia64.c (ia64_compute_frame_size): Don't include pr_size
	in fr_pad_size calculation.
	...

Co-Authored-By: Andrew Haley <aph@cygnus.com>
Co-Authored-By: Jim Wilson <wilson@cygnus.com>

From-SVN: r33424
2000-04-25 16:16:20 -07:00
Jim Wilson fbc18d1984 Fix nit.
* config/ia64/ia64.c: Delete stdio.h and ctype.h includes.

From-SVN: r33007
2000-04-07 11:51:44 -07:00
Jim Wilson d4daa0b423 Fix misscheduling of epilogue predicate register restore.
* config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC): Move case 6...
	(rtx_needs_barrier, case UNSPEC_VOLATILE): to here.
	* config/ia64/ia64.md (pr_restore): Change UNSPEC to UNSPEC_VOLATILE.

From-SVN: r32714
2000-03-23 11:38:24 -08:00
Jim Wilson 1ff5b671b6 Minor performance improvements. Minor EH/unwind bug fix.
* config/ia64/ia64.c (ia64_expand_prologue): Don't abort if leaf
	function uses output registers.  Don't save RP for leaf functions.
	Do save RP even if no epilogue.
	* config/ia64/ia64.h (FIXED_REGISTERS): Unmark in/out registers.
	(CALL_USED_REGISTERS): Unmark in registers.
	(REG_ALLOC_ORDER): Move out regs up, to near the top.  Move in regs up,
	to near the middle.

From-SVN: r32661
2000-03-20 20:05:49 -08:00
Jim Wilson e65271be0f Put 1999 years back.
* config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h,
	config/ia64/ia64.md, config/ia64/xm-ia64.h: Fix copyrights again.

From-SVN: r32609
2000-03-17 12:06:49 -08:00
Jim Wilson 294dac8081 Fix bug found by make bootstrap failure. Eliminate some warnings.
* config/ia64/ia64.c (ia64_compute_frame_size): Align size to
	STACK_BOUNDARY.
	* config/ia64/ia64.h (REGISTER_MOVE_COST): Add missing parentheses.

From-SVN: r32487
2000-03-12 00:00:08 -08:00
Jim Wilson be480cec4f ia64-protos.h, [...]: Fix copyright messages.
* config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h,
	config/ia64/ia64.md, config/ia64/xm-ia64.h: Fix copyright messages.

From-SVN: r32483
2000-03-11 16:20:06 -08:00
Robert Lipe ed9ccd8a79 Patch from Robert Lipe
* config/ia64/ia64.c: Include system.h.

From-SVN: r32455
2000-03-09 13:06:33 -08:00
Jim Wilson c65ebc55ca Add ia64 port.
From-SVN: r32438
2000-03-08 16:26:04 -08:00