blt
Branch if less than
- Extension
- RV32I/RV64I base integer
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
blt xs1, xs2, imm- Length
- 32-bit
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[12|10:5] | rs2 | rs1 | 100 | imm[4:1|11] | 11000 | 11 | |||||||||||||||||||||||||
Match 0x00004063, mask 0x0000707f. Source: blt bimm12hi rs1 rs2 bimm12lo 14..12=4 6..2=0x18 1..0=3 in riscv-opcodes/extensions/rv_i.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[12|10:5] | 31:25 | bimm12hi |
| rs2 | 24:20 | rs2 |
| rs1 | 19:15 | rs1 |
| imm[4:1|11] | 11:7 | bimm12lo |
Description
Branch to PC + imm if the signed value in register xs1 is less than the signed value in register xs2.
Raise a MisalignedAddress exception if PC + imm is misaligned.
Description from riscv-unified-db, reformatted.
Operation
XReg lhs = X[xs1];
XReg rhs = X[xs2];
if ($signed(lhs) < $signed(rhs)) {
jump_halfword($pc + $signed(imm));
}Pseudocode in riscv-unified-db’s IDL, quoted unchanged.