auipc

Add upper immediate to pc

This instruction is defined by:

  • I, version >= 0

This instruction is included in the following profiles:

  • MockProfile 64-bit Unpriv (Mandatory)

  • MockProfile 64-bit S-mode (Mandatory)

  • RVA20U64 (Mandatory)

  • RVA22U64 (Mandatory)

  • RVI20U32 (Mandatory)

  • RVI20U64 (Mandatory)

Encoding

svg

Assembly format

auipc rd, imm

Synopsis

Add an immediate to the current PC.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<32> imm = {$encoding[31:12], 12'd0};
Bits<5> rd = $encoding[11:7];

Execution

  • IDL

  • Sail

X[rd] = $pc + imm;
{
  let off : xlenbits = sign_extend(imm @ 0x000);
  let ret : xlenbits = match op {
    RISCV_LUI   => off,
    RISCV_AUIPC => get_arch_pc() + off
  };
  X(rd) = ret;
  RETIRE_SUCCESS
}