c.add

Add

This instruction is defined by:

Encoding

svg

Synopsis

Add the value in rs2 to rd, and store the result in rd. C.ADD expands into add rd, rd, rs2.

Access

M

HS

U

VS

VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> rs2 = $encoding[6:2];
Bits<5> rd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

XReg t0 = X[rd];
XReg t1 = X[rs2];
X[rd] = t0 + t1;
XReg t0 = X[rd];
XReg t1 = X[rs2];
X[rd] = t0 + t1;