csrrs

Atomically read and set bits in a CSR. Reads the value of the CSR, zero-extends the value to `XLEN` bits, and writes it to integer register `xd`. The initial value in integer register `xs1` is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in `xs1` will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are not explicitly written.

Synopsis

csrrs xd, csr, xs1

Encoding

Type:

067111214151920311110011xd010xs1csr
funct3: 010
opcode: 1110011

RISC-V Instruction Encoder/Decoder

open csrrs in rvcodecjs

Availability