35.3.6.4. INTEGER COMPARES AND CONDITIONAL JUMPS ON MIPS
+-------------------------------+
| Len Value |
| 6 opcode |
| 5 rs |
| 5 rt |
| 16 offset |
+-------------------------------+
Command Opcode Description
BEQ rs,rt,offset 0001 00 Branch on Equal (MIPS I)
BEQL rs,rt,offset 0101 00 Branch on Equal Likely (MIPS II)
BNE rs,rt,offset 0001 01 Branch on Not Equal (MIPS I)
BNEL rs,rt,offset 0101 01 Branch on Not Equal Likely (MIPS II)
cond <- (GRP[rs] COMPARE GPR[rt])
if (cond)
{
PC <- PC + sign_ext(offset * 4)
}
if (Branch likely)
{
NullifyCurrentInstruction()
}
+-------------------------------+
| Len Value |
| 6 000001 = REGIMM |
| 5 rs |
| 5 xxxx |
| 16 offset |
+-------------------------------+
(Likely is MIPS II, other MIPS I)
Command xxxx Desrcription
BGEZ rs,offset 00001 Branch on Greater than or Equal to zero
BGEZAL rs,offset 10001 Branch on Greater than or Equal to zero
and link
BGEZALL rs,offset 10011 Branch on Greater than or Equal to zero
and link likely
BGEZL rs,offset 00011 Branch on Greater than or Equal to zero
Likely
BLTZ rs,offset 00000 Branch on less than zero
BLTZAL rs,offset 10000 Branch on less than zero and link
BLTZALL rs,offset 10010 Branch on less than zero and link likely
BLTZL rs,offset 00010 Branch on less than zero Likely
cond <- GPR[rs] COMPARE 0
GPR[31] <- PC + 8 // Link only
if (cond)
PC <- PC + sign_ext(offset * 4)
else // Likely only
NullifyCurrentInstruction // Likely only
+-------------------------------+
| Len Value |
| 6 opcode |
| 5 rs |
| 5 0 |
| 16 offset |
+-------------------------------+
(Likely is MIPS II, other MIPS I)
Command opcode
BGTZ rs,offset 000111 Branch on Greater than zero
BGTZL rs,offset 010111 Branch on Greater than zero Likely
BLEZ rs,offset 000110 Branch on Less than equal to zero
BLEZL rs,offset 010110 Branch on Less than equal to zero likely
cond <- GPT[rs] COMPARE 0
if (cond)
{
PC <- PC + sign_ext(offset * 4)
} else {
NullifyCurrentInstuction // Likely only
}
// ----------------------------------------------------------------------
Index Prev Next