ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

csrrci

T1 riscv system insn
Atomic Read and Clear Bits in CSR with Immediate
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zicsr
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZicsr

Summary

The CSRRCI variant is similar to CSRRC, except this updates the CSR using an XLEN-bit value obtained by zero-extending a 5-bit unsigned immediate (imm[4:0]) field encoded in the xs1 field instead of a value from an integer register. For CSRRCI, if the imm[4:0] field is zero, then this instruction will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on a CSR write, nor…

Syntax / Encoding

csrrci xd, csr, imm | xxxxxxxxxxxxxxxxx111xxxxx1110011 (mask=0x0000707f match=0x00007073)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RVxxxxxxxxxxxxxxxxx111xxxxx11100110x0000707f / 0x00007073

Operands

NameDescription
csrbits [31:20]
immbits [19:15]
xdbits [11:7]

Reference Notes

The CSRRCI variant is similar to CSRRC, except this updates the CSR using an XLEN-bit value obtained
by zero-extending a 5-bit unsigned immediate (imm[4:0]) field encoded in the `xs1` field instead of a
value from an integer register. For CSRRCI, if the `imm[4:0]` field is zero, then this instruction
will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on
a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs. The CSRRCI will
always read the CSR and cause any read side effects regardless of `xd` and `xs1` fields.