Zicsr Instructions
6 RISC-V instructions in this extension - click any row for encoding, pseudocode, and full documentation.
| Mnemonic | Syntax | Format | Summary |
|---|---|---|---|
| CSRRC | CSRRC rd, csr, rs1 | I-Type | Reads the old value of the CSR, then clears bits in the CSR based on the mask in rs1. |
| CSRRCI | CSRRCI rd, csr, uimm | I-Type | Clears bits in a CSR using a 5-bit unsigned immediate. |
| CSRRS | CSRRS rd, csr, rs1 | I-Type | Reads the value of the CSR into rd, then bitwise ORs the value in rs1 into the CSR (setting bits). |
| CSRRSI | CSRRSI rd, csr, uimm | I-Type | Sets bits in a CSR using a 5-bit unsigned immediate. |
| CSRRW | CSRRW rd, csr, rs1 | I-Type | Atomically swaps values in the CSRs. Reads the old value of the CSR into rd, then writes rs1 to the CSR. |
| CSRRWI | CSRRWI rd, csr, uimm | I-Type | Updates a CSR using a 5-bit unsigned immediate (zimm) instead of a register. |