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: Optimize IA64 brl to br


On Thu, 2004-01-29 at 09:07, H. J. Lu wrote:
> I was told that br is faster than brl. It has something to do with
> branch prediction on hardware.

Section 8.4 "The brl Instruction" of the Itanium2 Processor Reference
Manual confirms that br is faster than brl.  brl will be mispredicted
more often than br.  Maybe it is because the branch prediction hardware
only handles 21-bit offsets?  Anyways, this is clearly something useful.

The patch looks OK.

I find the link_info->need_relax_finalize stuff a little cryptic.  I had
to look at the linker again to see why you handle finalization
differently for PCREL60B than PCREL21B.  We want to handle brl only on
the last relaxation pass, after all relaxations that might increase the
code size have already been performed.  It wouldn't hurt if this was in
a comment.

Also, I'd suggest putting the code that does the brl->br conversion in a
subroutine.  It detracts from what the relax_section code is doing.  The
ldxmov conversion code is in a subroutine already for instance.
-- 
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]