Architecture

instruction in the delay slot is executed during the jump).

The following notes apply to Table 3-10.

The target address of a branch instruction is generated by adding the address of the instruction in the delay slot (the instruction to be executed during the branch) to the 16-bit offset (that has been left-shifted two bits and sign-extended to 32 bits). Branch instructions are executed with a one-cycle delay.

In the case of the Branch Likely instructions in Table 3-10, if the branch condition is not met and the branch is not taken, the instruction in the delay slot is treated as a NOP.

 

Table 3-10. Branch instructions

 

 

 

 

(a)

 

BEQ, BNE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction

Format and Description

 

 

 

 

 

 

 

 

 

op

 

rs

 

rt

offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Branch on

BEQ rs, rt, offset

 

 

 

 

 

 

 

 

Equal

Branch to the target if the contents of registers rs and rt are equal.

Branch on Not

BNE rs, rt, offset

 

 

 

 

 

 

 

 

Equal

Branch to the target if the contents of registers rs and rt are not equal.

 

(b)

BLEZ, BGTZ

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction

Format and Description

 

 

 

 

 

 

 

 

 

op

 

rs

 

0

offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Branch on

BLEZ rs, offset

 

 

 

 

 

 

 

 

Less Than or

Branch to the target if register rs is 0 or less.

 

 

 

Equal Zero

 

 

 

 

 

 

 

 

 

Branch on

BGTZ rs, offset

 

 

 

 

 

 

 

 

Greater Than

Branch to the target if register rs is greater than 0.

 

 

 

Zero

 

 

 

 

 

 

 

 

 

 

(c) BLTZ, BGEZ, BLTZAL, BGEZAL

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction

Format and Description

 

 

 

 

 

 

 

 

 

op

 

rs

 

funct

offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Branch on

BLTZ rs, offset

 

 

 

 

 

 

 

 

Less Than

Branch to the target if register rs is less than zero

 

 

 

Zero

 

 

 

 

 

 

 

 

 

Branch on

BGEZ rs, offset

 

 

 

 

 

 

 

 

Greater Than

Branch to the target if register rs is 0 or greater.

 

 

 

or Equal Zero

 

 

 

 

 

 

 

 

 

Branch on

BLTZAL rs, offset

 

 

 

 

 

 

 

 

Less Than

Store in r31 (link register) the address of the instruction following the instruction

Zero And Link

in the delay slot (the one to be executed during the branch). If register rs is less

 

than 0, branch to the target.

 

 

 

 

 

Branch on

BGEZAL rs, offset

 

 

 

 

 

 

 

 

Greater Than

Store in r31 (link register) the address of the instruction following the instruction

or Equal Zero

in the delay slot (the instruction in the delay slot is executed during the branch).

And Link

If register rs is 0 or greater, branch to the target.

 

 

 

33

Page 42
Image 42
Toshiba TX39 user manual Instruction in the delay slot is executed during the jump, Branch instructions