RDCYCLE
Read Cycle Counter
RDCYCLE rd
Reads the lower 32/64 bits of the cycle counter.
Encoding
Binary Layout
11000000000000000010
31:12
rd
11:7
1110011
6:0
Operands
-
rd
Destination register (integer)
Example
RDCYCLE x10
// Get cycle count for performance timing.
Related
More in Pseudo
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
RDCYCLE reads the cycle CSR, which counts the number of clock cycles executed by the processor. It is an assembler pseudoinstruction for CSRRS rd, cycle, x0.
Operation
R[rd] = CSR[cycle];