csrrwi

Operands

reg, csr, imm

Atomic Read/Write CSR Immediate: read from the CSR into t0 and write a constant into the CSR

Variants

  • Atomic Read/Write CSR Immediate: read from the CSR into t0 and write a constant into the CSR csrrwi t0, fcsr, 10
# Initialize fcsr=0; csrrwi returns old fcsr in t0 and leaves fcsr=1.
.text
li t3, 0
csrw t3, fcsr
csrrwi t0, fcsr, 1