sltiu
Set on less than immediate unsigned
- Extension
- RV32I/RV64I base integer
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
sltiu xd, xs1, imm- Length
- 32-bit
Encoding
| 3120 | 1915 | 1412 | 117 | 62 | 10 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[11:0] | rs1 | 011 | rd | 00100 | 11 | ||||||||||||||||||||||||||
Match 0x00003013, mask 0x0000707f. Source: sltiu rd rs1 imm12 14..12=3 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv_i.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[11:0] | 31:20 | imm12 |
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
Places the value 1 in register xd if register xs1 is less than the sign-extended immediate
when both are treated as unsigned numbers (i.e., the immediate is first sign-extended to
XLEN bits then treated as an unsigned number), else 0 is written to xd.
Note: sltiu xd, xs1, 1 sets xd to 1 if xs1 equals zero, otherwise sets xd to 0
(assembler pseudoinstruction SEQZ xd, rs).
Description from riscv-unified-db, reformatted.
Operation
Bits<MXLEN> sign_extend_imm = $signed(imm); X[xd] = (X[xs1] < sign_extend_imm) ? 1 : 0;
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.