CZERO.EQZ
Conditional Zero Equal to Zero
CZERO.EQZ rd, rs1, rs2
Moves rs1 to rd if rs2 is non-zero, otherwise sets rd to zero.
Details
CZERO.EQZ conditionally zeroes rd: it writes zero to rd if rs2 equals zero, otherwise writes the value of rs1 to rd. Useful for branch-free conditional selection.
Pseudocode Operation
if (R[rs2] == 0) R[rd] = 0; else R[rd] = R[rs1];
Example
CZERO.EQZ x10, x11, x12
Encoding
Binary Layout
0000111
31:25
rs2
24:20
rs1
19:15
101
14:12
rd
11:7
0110011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Source -
rs2
Condition