pacga

Pointer Authentication Code Generic Address

PACGA <Xd>, <Xn>, <Xm>

Computes a pointer authentication code for an address and modifier.

Details

Computes a pointer authentication code (PAC) for a generic address using the provided address and modifier. The result is placed in Xd with only the PAC bits set; other bits are cleared. No condition flags are affected. AArch64-only; requires PAC extension; may trap if PAC key is not initialized.

Pseudocode Operation

pac ← ComputePAC(Xn, Xm, PAC_key_generic)
Xd ← SignExtend(pac, 64)

Example

PACGA x0, x1, x2

Encoding

Binary Layout
1
0
0
11010110
Rm
001100
Rn
Rd
 
Format Data Processing
Opcode 0x9AC03000
Extension PAC (Security)

Operands

  • Xd
    Destination 64-bit integer register
  • Xn
    Address
  • Xm
    Modifier

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x9AC03000 PACGA <Xd>, <Xn>, <Xm|SP> A64 1 | 0 | 0 | 11010110 | Rm | 001100 | Rn | Rd

Description

Pointer Authentication Code, using Generic key. This instruction computes the pointer authentication code for a 64-bit value in the first source register, using a modifier in the second source register, and the Generic key. The computed pointer authentication code is written to the most significant 32 bits of the destination register, and the least significant 32 bits of the destination register are set to zero.

Operation

if source_is_sp then
    X[d, 64] = AddPACGA(X[n, 64], SP[]);
else
    X[d, 64] = AddPACGA(X[n, 64], X[m, 64]);