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
?
31:16
1001
15:12
rd_rs1_n0
11:7
c_rs2_n0
6:2
10
1:0
 
Format CR
Opcode 0x00009002
Extension C

Operands

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