C.ADD

Compressed Add

C.ADD rd, rs2

Adds two registers.

Details

Adds the value of a register to rd/rs1 and writes the result back to rd. 16-bit encoding of ADD.

Pseudocode Operation

R[rd] = R[rd] + R[rs2];

Example

C.ADD x10, x11

Encoding

Binary Layout
1001
15:12
rd
11:7
rs2
6:2
10
1:0
 
Format CR
Opcode 02
Extension C

Operands

  • rd
    Dest/Src1
  • rs2
    Source register 2 (integer)