MIPS assembler branch relaxations

Paul Koning pkoning@equallogic.com
Sat Sep 14 15:00:00 GMT 2002


>>>>> "Daniel" == Daniel Jacobowitz <drow@mvista.com> writes:

 Daniel> On Sat, Sep 14, 2002 at 02:59:45AM -0300, Alexandre Oliva
 Daniel> wrote:
 >> This patch arranges for the MIPS assembler to turn out-of-range
 >> branches into jumps.  No regressions are introduced in the
 >> binutils testsuites for a mips-linux build.  Details on how it is
 >> done are in comments in the beginning of the patch.  Ok to
 >> install?

 Daniel> A couple of thoughts:

 Daniel> + beql reg1, reg2, 1f + nop + beqzl $0, 2f + nop + 1: j[al]
 Daniel> label + delay slot (executed only if branch taken) + 2:

 Daniel> Why beqzl?  Admittedly, I don't know much about MIPS
 Daniel> hardware, but I'd think that just "b" would probably be
 Daniel> faster, since that's the normal unconditional branch.

Not only that, but MIPS64 explicitly deprecates all flavors of "branch
likely" which is why gcc has a way to avoid generating them.  So the
assembler should either have the same conditional stuff, or avoid them
entirely.  

	   paul



More information about the Binutils mailing list