addpt

Add Checked Pointer

ADDPT <Xd|SP>, <Xn|SP>, <Xm>{, LSL #<amount>}

Adds offset to pointer with tag check (Checked Pointer Arithmetic).

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
1
31
0
30
0
29
11010000
28:21
Rm
20:16
001
15:13
imm3
12:10
Rn
9:5
Rd
4:0
 
Format Data Processing
Opcode 0x9A002000
Extension FEAT_CPA (v9.5)

Operands

  • Xd
    Dest
  • Xn
    Ptr
  • Xm
    Offset

Related

More in FEAT_CPA (v9.5)

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x9A002000 ADDPT <Xd|SP>, <Xn|SP>, <Xm>{, LSL #<amount>} A64 1 | 0 | 0 | 11010000 | Rm | 001 | imm3 | Rn | Rd
0x04C40000 ADDPT <Zdn>.D, <Pg>/M, <Zdn>.D, <Zm>.D A64 00000100 | 1 | 1 | 000 | 10 | 0 | 000 | Pg | Zm | Zdn
0x04E00800 ADDPT <Zd>.D, <Zn>.D, <Zm>.D A64 00000100 | 1 | 1 | 1 | Zm | 000 | 01 | 0 | Zn | Zd

Description

Add checked pointer adds a base address register value and an optionally-shifted register value, and writes the result to the destination register. The optionally-shifted register value is treated as the offset. If the operation would have generated a result where the most significant 8 bits of the result register differ from the most significant 8 bits of the base register, then the result is modified such that it is likely to be non-canonical when used as an address.

Operation

bits(64) result;
bits(64) base = if n == 31 then SP[] else X[n, 64];
bits(64) offset = LSL(X[m, 64], shift);

result = base + offset;

result = PointerAddCheck(result, base);

if d == 31 then
    SP[] = result;
else
    X[d, 64] = result;