czero.nez

Conditional zero, if condition is nonzero

If xs2 contains a nonzero value, 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.

Assembly format

czero.nez rd, rs1, rs2

Decode Variables

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

Execution

  • IDL

  • Sail

X[xd] = (X[xs2] != 0) ? 0 : X[xs1];
{
  let value = X(rs1);
  let condition = X(rs2);
  let result : xlenbits = if (condition != zeros()) then zeros()
						    else value;
  X(rd) = result;
  RETIRE_SUCCESS
}

Encoding

svg

Defining extension

Zicond, version >= Zicond@1.0.0

Access

M

Always

Containing profiles

  • Mandatory: RVA23M64, RVA23S64, RVA23U64, RVB23M64, RVB23S64, RVB23U64

  • Optional: