addi

Add immediate

This instruction is defined by:

Encoding

svg

Synopsis

Adds an immediate value to the value in xs1, and store the result in xd

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

signed Bits<12> imm = sext($encoding[31:20], 12);
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

X[xd] = X[xs1] + $signed(imm);
X[xd] = X[xs1] + $signed(imm);