Webcentive RISC-V Reference

slti

Set on less than immediate

Extension
RV32I/RV64I base integer
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
slti xd, xs1, imm
Length
32-bit

Encoding

3120191514121176210
imm[11:0]rs1010rd0010011

Match 0x00002013, mask 0x0000707f. Source: slti rd rs1 imm12 14..12=2 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv_i.

FieldBitsriscv-opcodes name
imm[11:0]31:20imm12
rs119:15rs1
rd11:7rd

Description

Places the value 1 in register xd if register xs1 is less than the sign-extended immediate when both are treated as signed numbers, else 0 is written to xd.

Description from riscv-unified-db, reformatted.

Operation

X[xd] = ($signed(X[xs1]) < $signed(imm)) ? '1 : '0;

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages