This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Add a stop bit in alignment for alloc.


On Mon, 2004-03-01 at 12:57, H. J. Lu wrote:
> 	* config/tc-ia64.c (ia64_handle_align): Add a stop bit for
> 	alloc.

This patch will result in one stop bit per bundle.  So if you align to a
32-byte boundary, you get 2 stop bits.  This is not optimal, but
probably not important enough to worry about.  Emitting alignment before
an alloc instruction is probably rare.

David's point about using IA64_OPCODE_FIRST is a good one.  This is only
available when parsing instructions though, it is not available when
relaxing rs_align_code frags.  However, perhaps we could set a bit in a
var frag to indicate that it needs to end in a stop bit.  The key place
would be insn_group_break.  This is called when we see an insn with the
IA64_OPCODE_FIRST bit set.  If there are instructions,
md.num_slots_in_use > 0, then it adds a stop bit to the previous
bundle.  So if there are no instructions num_slot_in_use == 0, and the
previous frag is an rs_align_code frag, then we mark the previous frag
as needing a stop bit at the end.

The problem here is that there is no obvious way to identify the
previous frag.  Frags don't have back pointers.  There isn't a
convenient hook to give the frag to us.

We could save frag_now in ia64_md_do_align.  The var frag would then be
either that frag, or the next one if the existing frag did not have
enough room left.

insn_group_break would then check to see if the next frag after the
saved var frag is the current one, in which case the saved var frag has
to end with a stop bit.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]