adrp

Form PC-relative Address to 4KB Page

ADRP <Xd>, <label>

Calculates page address of a label (PC +/- 4GB range).

Details

Forms a PC-relative page address by shifting a signed 21-bit offset left by 12 bits and adding to the current PC (with lower 12 bits zeroed), storing the result in the destination register. Supports label references within ±4 GB and is typically used with subsequent ldr or add instructions for full address formation. This is an AArch64-only instruction that does not affect condition flags.

Pseudocode Operation

Xd ← (PC & ~0xFFF) + (SignExtend(immhi:immlo, 21) << 12)

Example

ADRP x0, label

Encoding

Binary Layout
1
immlo
10000
immhi
Rd
 
Format PC-rel
Opcode 0x90000000
Extension Base

Operands

  • Xd
    Destination 64-bit integer register
  • label
    Label

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x90000000 ADRP <Xd>, <label> A64 1 | immlo | 10000 | immhi | Rd

Description

Form PC-relative address to 4KB page adds an immediate value that is shifted left by 12 bits, to the PC value to form a PC-relative address, with the bottom 12 bits masked out, and writes the result to the destination register.

Operation

bits(64) base = PC64<63:12>:Zeros(12);
X[d, 64] = base + imm;