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: relax jalr $t9 [R_MIPS_JALR symbol] to bal symbol


Ralf Baechle wrote:
> On Mon, Mar 24, 2003 at 07:56:22PM -0800, Richard Henderson wrote:
> 
> > Um, I dunno.  I suspect that bal will never be slower than jal
> > on any implementation; it's not impossible that the reverse is
> > not true.  Anyone know how this affects Real Life Implementations?
> 
> bal is actually bgezall $zero, dest that is a conditional branch with
> a condition that is always true.  I can't imagine implementations are
> intelligent enough to detect this special case in their branch prediction
> so branches may occasionally be misspredicted.  Still better the jalr
> instruction which occasionally may take the penalty for loading the
> destination address from the GOT and fetching another cacheline from
> memory.  So I'd say go for the bal thing.

I don't understand your reasoning here. AFAICS the question is to use
b/bal or j/jal for relaxing, where the latter would save branch
mispredictions.


Thiemo


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