csrrci
Atomic read/clear CSR immediate
Reads the CSR into t0 and clears the CSR bits that are set in a 5-bit constant, as one atomic step.
Forms
csrrci , ,
Operands
t0- Any integer register,
x0tox31, or its named alias, such aszero,t0ort6. csr- A control and status register, written by name or number, such as
fcsr,fflags,frm,cycle,time,instret,ustatus,uepc,ucauseorutval. See the supported registers. imm5- An unsigned 5-bit immediate,
0to31, used for values such as a shift count or a CSR immediate.
# Initialize fcsr=1; csrrci returns old fcsr in t0 and leaves fcsr=0.
.text
li t3, 1
csrw t3, fcsr
csrrci t0, fcsr, 1