sltiu

Set on less than immediate unsigned

This instruction is defined by:

Encoding

svg

Synopsis

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.

sltiu xd, xs1, 1 sets xd to 1 if xs1 equals zero, otherwise sets xd to 0 (assembler pseudoinstruction SEQZ xd, rs).

Access

M

HS

U

VS

VU

Always

Always

Always

Always

Always

Decode Variables

Bits<12> imm = $encoding[31:20];
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

Bits<MXLEN> sign_extend_imm = $signed(imm);
X[xd] = (X[xs1] < sign_extend_imm) ? 1 : 0;
Bits<MXLEN> sign_extend_imm = $signed(imm);
X[xd] = (X[xs1] < sign_extend_imm) ? 1 : 0;