seqzpseudo

seqz

pseudo
RISC-V Assembly Reference

lyszt.net covers seqz and other RISC-V instructions in more detail.

Description

Writes 1 when a value is zero, otherwise 0. In seqz rd, rs, the result is 1 when rs equals zero. The test covers empty counters, successful calls and string ends, and the assembler expands it to sltiu rd, rs, 1.

Expands to

sltiu rd, rs, 1

The assembler replaces this pseudo-instruction with the real instruction or instructions listed above.

Official definition

RISC-V Instruction Set Manual

SLTI (set less than immediate) places the value 1 in register rd if register rs1 is less than the sign-extended immediate when both are treated as signed numbers, else 0 is written to rd. SLTIU is similar but compares the values as unsigned numbers (i.e., the immediate is first sign-extended to XLEN bits then treated as an unsigned number). Note, SLTIU rd, rs1, 1 sets rd to 1 if rs1 equals zero, otherwise sets rd to 0 (assembler pseudoinstruction SEQZ rd, rs).