adrp
Form PC-relative Address to 4KB Page
ADRP <Xd>, <label>
Calculates page address of a label (PC +/- 4GB range).
Pseudocode Operation
Xd ← (PC & ~0xFFF) + (SignExtend(immhi:immlo, 21) << 12)
Example
ADRP x0, label
Encoding
Binary Layout
1
31
immlo
30:29
10000
28:24
immhi
23:5
Rd
4:0
Operands
-
Xd
Destination 64-bit integer register -
label
Label
Related
More in Base
Reference
View in Arm A64 ISA 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;