seqzpseudo
seqz
rd, rspseudo
rd = (rs == 0) ? 1 : 0

seqz checks whether a register holds zero. Its name reads as set if equal to zero. The form seqz rd, rs writes 1 into destination register rd when source register rs is zero, and 0 when rs is anything else. It hands you a clean true/false answer — 1 or 0 — to the question is this value zero.

It is a pseudo-instruction: not a real machine operation, but a readable name the assembler rewrites into a genuine one. Here it becomes sltiu rd, rs, 1 — a comparison asking whether the value is below 1, which for unsigned numbers is only true of 0 itself. You can write seqz and let the assembler handle that translation.

Its most important job is building equality tests, because RISC-V has no direct are these two equal instruction. The trick is two steps: XOR the two values together, which gives exactly zero when they match and non-zero when they differ, then seqz that result. A 1 means the originals were equal. (The xor page explains why XOR detects sameness this way.)

More broadly, seqz flips the sense of a true/false value: a register holding 0 becomes 1, and anything non-zero becomes 0. Because the answer is an ordinary number rather than a jump, it can flow straight into further arithmetic — for instance, multiplying by it to conditionally zero something out. Its mirror image is snez, which tests for non-zero instead.

Expands to
sltiu rd, rs, 1

A pseudo-instruction: the assembler turns it into the real instruction(s) above.