(record_reg_life_pat): Rewrite to handle any sort of pattern.
(record_reg_life): Change interface to record_reg_life_pat.
(stack_reg_life_analysis): Don't assume that MODE_FLOAT values are
always returned in a float reg.
(subst_stack_regs_pat): Add support for sin and cos insns.
From-SVN: r1980
Enhance to fill the last delay slot of a call with an
unconditional jump.
(fill_simple_delay_slots): Look for the case of a call/branch
first. If this applies, record the jump as `last_delay_insn'.
Later, don't look for additional delay insns if the last one has
alreay been filled.
(mark_target_live_regs): A sequence may end in an unconditional
branch.
From-SVN: r1969
Major rework to have caller-saves emit load/store double insns when
possible and to avoid useless resaving of registers restored for
source accesses only.
* caller-save.c (toplevel): All arrays are multi-dimensional to
hold information for multiple save/restore insns. New variable
hard_regs_need_restore.
(choose_hard_reg_mode): New argument `nregs' indicating how many
hard registers are desired. All callers changed.
(init_caller_save): Change initialization to handle multiple
register saves. A call-used register can not be live across
if we can not find a single register mode to save it in.
(multiple register saves are optional)
(init_save_areas): Change initialization of regno_save_mem to
handle multiple register saves.
(setup_save_areas): Allocate space for consecutive hard registers
in aligned consecutive memory locations. When allocating space
for consecutive hard registers, also initialize regno_save_mem
for each hard register stored as a single word.
(save_call_clobbered_regs): Initialize hard_regs_need_restore.
Set hard_regs_need_restore to hard_regs_saved after crossing
a call. Also recompute n_regs_saved. At the end of a basic block
we need only restore registers in hard_regs_need_restore.
(set_reg_live, clear_reg_live): Do the right thing for
hard_regs_need_restore and hard_regs_saved.
(restore_referenced_regs): Just return if X is a clobber.
Test hard_regs_need_restore to determine when to restore a hard
register from the save area.
(insert_save_restore): Now returns the number of extra registers
saved/restored. New argument `maxrestore' which constrains how
many hard registers should be restored. All callers changed.
Do stores of consecutive registers with double store insns if
possible. Else do them with single word insns. Likewise for
loads, except constrained by maxrestore. Set hard_regs_saved
and hard_regs_need_restore appropriately to minimize useless
saves into the save area. Test against hard_regs_need_restore
when trying to restore multiple regs and similarly test against
hard_regs_saved when storing multiple regs.
From-SVN: r1964
(current_block): New function.
(struct binding_level): New field this_block.
(poplevel): Use this_block if nonzero, rather than making new BLOCK.
(insert_block, delete_block): New functions.
From-SVN: r1958
(float*, fix*): Rewrite to match hardware; take/put
integer input/output from/to fp register instead of memory or
general register. Delete 6 now obsolete combiner patterns.
From-SVN: r1957
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
Pass CLOCK to schedule_insn.
Compute the tail in the scheduling loop, not before it.
Enable the stall code that advances the insn queue.
Select the insn to schedule and block others with schedule_select.
(adjust_priority): Renamed from launch_link.
(schedule_insn): Renamed from launch_links.
(insn_queue): Use INSN_QUEUE_SIZE.
(insn_units, insn_blockage, insn_tick, unit_last_insn,
unit_tick, unit_n_insns): New variables.
(schedule_insns): Allocate and initialize insn_tick, insn_units, and
insn_blockage.
(insn_unit, blockage_range, clear_units, prepare_unit, schedule_unit,
actual_hazard_this_instance, actual_hazard, potential_hazard,
schedule_select): New functions.
(schedule_block): Add dependencies to force insns to remain in order
at the end of a block rather than relying on having the scheduler
issue them in priority order.
(insn_cost): Add LINK and USED parameters. All callers
changed. Supply an ADJUST_COST interface.
(insn_cost): Make a dependence from a USE insn free.
(priority): Clear the link cost adjustment bits.
From-SVN: r1951
(write_units): Add blockage_function, blockage_range_function,
max_blockage and max_issue_delay fields to struct function_unit_desc.
Drop max_busy_cost field. Write #defines for min/max blockage,
issue delay, multiplicity, and simultaneity and for BLOCKAGE_BITS
and INSN_QUEUE_SIZE.
(main): Compute the new values.
From-SVN: r1950