CSRRCI

CSR Read and Clear Immediate

CSRRCI rd, csr, uimm

Clears bits in a CSR using a 5-bit unsigned immediate.

Details

CSRRCI atomically reads CSR csr into rd, then clears bits in the CSR corresponding to set bits in the zero-extended 5-bit immediate. If the immediate is zero, no bits are modified.

Pseudocode Operation

t = CSRs[csr]; CSRs[csr] = t & ~zext(uimm); R[rd] = t;

Example

CSRRCI x0, sstatus, 2

Encoding

Binary Layout
csr
31:20
zimm5
19:15
111
14:12
rd
11:7
1110011
6:0
 
Format I-Type
Opcode 0x00007073
Extension Zicsr

Operands

  • rd
    Destination register (integer)
  • csr
    CSR Address
  • uimm
    Bit Mask