lui

Load upper immediate

Load the zero-extended imm into xd.

This instruction must have data-independent timing when extension Zkt is enabled.

Assembly format

lui rd, imm

Decode Variables

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

Execution

  • IDL

  • Sail

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

Encoding

svg

Defining extension

  • I, version >= I@2.1.0

Access

M HS U VS VU

Always

Always

Always

Always

Always

Containing profiles

  • Mandatory: MockProfile 64-bit S-mode, MockProfile 64-bit Unpriv, RVA20S64, RVA20U64, RVA22S64, RVA22U64, RVA23M64, RVA23S64, RVA23U64, RVB23M64, RVB23S64, RVB23U64, RVI20U32, RVI20U64

  • Optional: