BLT

Branch if Less Than

BLT rs1, rs2, offset

Take the branch if rs1 is less than rs2 (signed).

Encoding

Binary Layout
bimm12hi
31:25
rs2
24:20
rs1
19:15
100
14:12
bimm12lo
11:7
1100011
6:0
 
Format B-Type
Opcode 0x00004063
Extension RV32I

Operands

  • rs1
    Source register 1 (integer)
  • rs2
    Source register 2 (integer)
  • offset
    Offset

Example

BLT x10, x11, exit

// Branch to 'exit' if x10 < x11 (signed comparison).

Related

More in RV32I

Description

BLT takes the branch if rs1 is less than rs2, using a signed comparison. The branch target is the PC plus the sign-extended B-immediate.

Operation

if (R[rs1] <s R[rs2]) PC += sext(offset);