snezpseudo
snez
rd, rspseudo
rd = (rs != 0) ? 1 : 0

snez is the opposite of seqz: it checks whether a register holds something *other* than zero. The name reads as set if not equal to zero. The form snez rd, rs writes 1 into rd when rs is any non-zero value, and 0 when rs is zero.

Like seqz, it is a pseudo-instruction — a convenient name the assembler turns into a real one, here sltu rd, zero, rs, which asks whether zero is less than the value (true for everything except zero itself). You write snez and the assembler supplies the translation.

The handy thing about snez is that it tidies any number into a clean true/false. Computations often leave you with a value that is meaningful only as is it zero or not — a count of remaining items, the difference between two things, a bundle of flags. snez collapses whatever that value is down to a plain 1 (if non-zero) or 0 (if zero), which is the standard form for a function to return a yes/no answer.

It pairs with XOR to test inequality: XOR two values (non-zero only when they differ), then snez to turn that into a 1-or-0 are these different result. Between snez and its mirror seqz, you can produce a clean true/false for both the equal and not-equal questions, ready to combine with the bitwise and and or instructions into more complex conditions — all without a single jump.

Expands to
sltu rd, zero, rs

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