csrrc

No synopsis available.

This instruction is defined by:

  • Zicsr, version >= Zicsr@2.0.0

This instruction is included in the following profiles:

Encoding

svg

Assembly format

csrrc rd, rs1, csr

Synopsis

No description available.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<12> csr = $encoding[31:20];
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

  • IDL

Boolean will_write = xs1 != 0;
check_csr(csr, will_write, $encoding);
XReg initial_csr_value = CSR[csr].sw_read();
if (xs1 != 0) {
  XReg mask = X[xs1];
  CSR[csr].sw_write(initial_csr_value & ~mask);
}
X[xd] = initial_csr_value;

Exceptions

This instruction may result in the following synchronous exceptions:

  • IllegalInstruction