This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: Add a stop bit in alignment for alloc.
- From: Jim Wilson <wilson at specifixinc dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: David Mosberger <davidm at hpl dot hp dot com>, binutils at sources dot redhat dot com,sje at cup dot hp dot com
- Date: 01 Mar 2004 15:18:38 -0800
- Subject: Re: Patch: Add a stop bit in alignment for alloc.
- References: <1076121975.3250.174.camel@leaf.tuliptree.org><16428.30544.173672.844344@napali.hpl.hp.com><1077009458.1053.6.camel@leaf.tuliptree.org><16434.38140.424393.737296@napali.hpl.hp.com><1077065305.1148.31.camel@leaf.tuliptree.org><16435.187.766200.581591@napali.hpl.hp.com><1077095246.4892.20.camel@leaf.tuliptree.org><16435.51117.464169.757826@napali.hpl.hp.com><1077137874.1058.37.camel@leaf.tuliptree.org><16435.57775.265658.442490@napali.hpl.hp.com> <20040301205732.GA26489@lucon.org>
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