MIPS assembler branch relaxations

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Sat Sep 14 21:39:00 GMT 2002


Daniel Jacobowitz wrote:
> On Sat, Sep 14, 2002 at 02:59:45AM -0300, Alexandre Oliva 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?
> 
> A couple of thoughts:
> 
> +        beql reg1, reg2, 1f
> +        nop
> +        beqzl $0, 2f
> +        nop
> +     1: j[al] label
> +        delay slot (executed only if branch taken)
> +     2:
> 
> Why beqzl?  Admittedly, I don't know much about MIPS hardware, but I'd
> think that just "b" would probably be faster, since that's the normal
> unconditional branch.

"b" isn't a valid opcode. :-)
Btw, "beqzl" also isn't one. In this special case I'd prefer "beq".


Thiemo



More information about the Binutils mailing list