csrr
RISC-V csrr Pseudo-Instruction Details
Assembler pseudo-instructionThe RISC-V csrr pseudo-instruction has the csrr expansion CSRRS rd, csr, x0 for read CSR. With rs1 as x0 it does not write the CSR, though read side effects may occur.
What You Write
csrr rd, csr
Typical Real Expansion
csrrs rd, csr, x0
What This Pseudo Instruction Is Saving You From Writing
Assembly Manual lists this pseudo-instruction form.
How To Read The Expansion
Step 1
Assembly Manual expands csrr rd, csr to csrrs rd, csr, x0.
Assembly Forms And Real Instructions
The RISC-V Assembly Programmer's Manual lists csrr as CSRRS rd, csr, x0.
Official References And Reading Order
This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.
FAQ
What does csrr expand to?
the RISC-V Assembly Programmer's Manual gives csrr rd, csr as csrrs rd, csr, x0.