SLTIU

Set Less Than Immediate Unsigned

SLTIU rd, rs1, imm

Sets rd to 1 if rs1 < immediate (unsigned comparison), otherwise 0.

Details

SLTIU compares rs1 against the sign-extended immediate treating both as unsigned integers, writing 1 to rd if rs1 < imm (unsigned), else 0. SLTIU rd, rs1, 1 implements SEQZ (set if equal to zero).

Pseudocode Operation

R[rd] = (R[rs1] <u sext(imm)) ? 1 : 0;

Example

SLTIU t0, a0, 16

Encoding

Binary Layout
imm[11:0]
31:20
rs1
19:15
011
14:12
rd
11:7
0010011
6:0
 
Format I-Type
Opcode 0x13
Extension RV32I

Operands

  • rd
    Destination register (integer)
  • rs1
    Source
  • imm
    Signed immediate value