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
 
Format I-Type
Opcode 0xC0002073
Extension Pseudo

Operands

  • rd
    Destination register (integer)

Example

RDCYCLE x10

// Get cycle count for performance timing.

Related

More in Pseudo

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];