Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AUIPC — add upper immediate to PC

auipc rd, imm20

Adds the upper immediate (imm20 << 12) to the address of the AUIPC instruction. It is the foundation for PC-relative address construction, calls, and position-independent code.

auipc t0, 0            # t0 receives the current PC

Relocation-aware la or call syntax is usually preferable to hand-writing the pair.

x86 connection: conceptually related to RIP-relative address formation, though RISC-V materialises the base in a general register.