AUIPC

Add Upper Immediate to PC

AUIPC rd, imm

Adds a 20-bit upper immediate to the Program Counter, used for PC-relative addressing.

Details

AUIPC (Add Upper Immediate to PC) forms a 32-bit offset from the 20-bit U-immediate (filling the low 12 bits with zeros), adds it to the PC of the AUIPC instruction, and places the result in rd. It is used for PC-relative addressing.

Pseudocode Operation

R[rd] = PC + (imm << 12);

Example

AUIPC x10, 0x1000

Encoding

Binary Layout
imm[31:12]
31:12
rd
11:7
0010111
6:0
 
Format U-Type
Opcode 0x17
Extension RV32I

Operands

  • rd
    Destination Register
  • imm
    20-bit Upper Immediate