czero.eqz

Conditional zero, if condition is equal to zero

This instruction is defined by:

Encoding

svg

Synopsis

If xs2 contains the value zero, this instruction writes the value zero to xd. Otherwise, this instruction copies the contents of xs1 to xd. This instruction carries a syntactic dependency from both xs1 and xs2 to xd. Furthermore, if the Zkt extension is implemented, this instruction’s timing is independent of the data values in xs1 and xs2.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> xs2 = $encoding[24:20];
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

X[xd] = (X[xs2] == 0) ? 0 : X[xs1];
X[xd] = (X[xs2] == 0) ? 0 : X[xs1];